|
Multiple macdefs in .netrc
Hi this is about using .netrc with multiple macro definitions for a single target server. I have seen this done successfully before, but am having trouble getting it working here.
my .netrc file is like the following:
machine server1
login userid1
password userpwd1
macdef ftp_cobol_from_prd
prompt
ascii
lcd /dir1/dir2/
cd /dira/dirb/dirc
mget *.cbl
bye
macdef ftp_logs_from_prd
prompt
ascii
lcd /dirz/dir1/log
cd /dirq/dir1/log
mget *.log
bye
macdef ftp_reports_from_prd
prompt
ascii
lcd /dir1/rpt/prd
cd /dirm/rpt
mget *.rpt
bye
From my shell script I call each macro like this:
echo '$ftp_cobol_from_prd'|ftp server1
Normally I can call each macdef and get it to work fine. I seem to be having issues though. The only macdef that gets executed is the first one no matter which macro I call.
As I said I have seen this work before, I am missing something, though.
Any Ideas?
Thanks!
|