.netrc -- macro not found error


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers .netrc -- macro not found error
# 1  
Old 03-06-2005
.netrc -- macro not found error

Hi!

Can you please advise if it is possible to have a .netrc file containing a login account for two different ftp servers and two diff macdef commands, and run the a specific macdef depending on the server?

I have copied part of the netrc file.

machine ftp1
login acct1
password psswrd1

machine ftp2
login acct2
password psswrd2


macdef macrodef1
run series of commands under macdef1

macdef macrodef2
run series of commands under macdef2


I Then I try to run it in my script using the following commands 'echo "\$ macrodef1" | ftp -v ftp1' and 'echo "\$ macrodef2" | ftp -v fpt2' but and I get a macro not found error. Please help. Thank you in advance for your help.
# 2  
Old 03-07-2005
try this way .....; Modify your .netrc this way and try it.

Code:
machine ftp1
login acct1
password psswrd1

macdef macrodef1
run series of commands under macdef1 

machine ftp2
login acct2
password psswrd2

macdef macrodef2
run series of commands under macdef2

# 3  
Old 03-07-2005
Thanks bhargav, it worked. I didnt know that the machine info and macdef info should be paired. Thanks much!
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Aclocal and libtool error -- macro `AM_PROG_LIBTOOL' not found in library

The software I'm trying to install uses macros with autoconf, aclocal, libtool, autoheader, and automake. What seems to be going on is an error between libtool and aclocal. From what I understand when I run aclocal, which is in /usr/bin, it searches a different directory for the libtool.m4 which is... (0 Replies)
Discussion started by: bphqk3
0 Replies

2. Shell Programming and Scripting

Help with macdef (.netrc)

Am trying a shell script for ftp process on Solaris I am trying to mget files to Destination server: myserverxxx1 folder : /backup/dumps/SERVER-1backup/afterbatch From Source server: SERVER-1 folder : /dumps/daily/backupafterbatch/Thu21Oct_04:22:37 depending on the date the... (1 Reply)
Discussion started by: sunnyboy
1 Replies

3. Programming

help with macro tween and syntax error

im working on a program that has to correctly add the macro TWEEN to the system (it determines if a string falls beween two other strings in a basic sort) im having problems doing this. here is what i got. int main(){ char name; scanf("%s",&name); if (TWEEN("ABC", name, "XYZ")) printf("%s... (4 Replies)
Discussion started by: rickym2626
4 Replies

4. Programming

Make-question - redefine a macro, using another macro..?

I think there is no problem to use any macro in a new macro definishion, but I have a problem with that. I can not understand why? I have a *.mak file that inludes file with many definitions and rules. ############################################## include dstndflt.mak ... One of the... (2 Replies)
Discussion started by: alex_5161
2 Replies

5. AIX

.netrc and ftp

Hello all, I am using a .netrc to automatically access an ftp host. Here is the line I use... machine 412.blank.com login nw\mylogin password ******* when I use this command... ftp 412.blank.com I get... Connected to 412.blank.com. 220 server_7 FTP server (EMC-SNAS: 5.5.25.2)... (4 Replies)
Discussion started by: magikalpnoi
4 Replies

6. UNIX for Advanced & Expert Users

using .netrc

Hi friends, Can we use the file .netrc for automating ftp from a perl script ? and if so then how do i go about it ? can i have a sample script for this ? thanks in advance Veera (6 Replies)
Discussion started by: sveera
6 Replies

7. Solaris

Compliation Error in solaris - macro "min" requires 2 arguments, but only 1 given

Hi, I am trying to compile our linux code base in solaris and came across the following issues. Am I suppose to do something special ? Can anyone help me to fix this issue. System : uname -a SunOS aspen 5.10 Generic_125100-08 sun4u sparc SUNW,Sun-Fire-280R The complier that I am using is... (0 Replies)
Discussion started by: learningkid
0 Replies

8. UNIX for Dummies Questions & Answers

.netrc file

hello, I am trying to write an automated script to transfer multiple files to another solaris 5.8 box. I am using the #! /bin/bash prompt and I am having trouble finding/creating the .netrc login file. I googled and the only info I got was that I should create/find it in my home directory. I went... (2 Replies)
Discussion started by: grandtheftander
2 Replies

9. UNIX for Dummies Questions & Answers

Help in .netrc

Hi, I would like to ask if the .netrc file should really be stored/placed in the /home/<userid> directory or in the home directory indicated by the uinfo command? I am currently having problems with a .netrc file which is owned by a id which has it's home directory pointed to a... (2 Replies)
Discussion started by: edu_escandor
2 Replies

10. Shell Programming and Scripting

.netrc question

Hi, id like to ask a question about .netrc. Id like to have 2 entries for a particular machine, but with different ftp userid's ie machine 172.19.8.26 login dcm password dcm macdef job1 bin hash bye machine 172.19.8.26 login ppp password ppp macdef job2 bin hash bye this code DOES... (8 Replies)
Discussion started by: hcclnoodles
8 Replies
Login or Register to Ask a Question