The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 10-01-2008
PSDba PSDba is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 4
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!