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



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
.netrc and ftp magikalpnoi AIX 4 07-07-2008 03:22 AM
using .netrc sveera UNIX for Advanced & Expert Users 6 03-26-2008 04:58 PM
.netrc file jithinravi UNIX for Dummies Questions & Answers 1 04-26-2007 06:01 AM
Help in .netrc edu_escandor UNIX for Dummies Questions & Answers 2 03-22-2005 07:12 AM
.netrc multiple ftp jobs to same machine hcclnoodles UNIX for Dummies Questions & Answers 3 03-21-2002 10:32 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #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!
  #2 (permalink)  
Old 10-03-2008
PSDba PSDba is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 4
I got it working. It appears to be related to the length and order of the macdef names. You have to have your macdefs in Alpha order and have the name differences occur in the first 8 characters or so. For example:

macdef ftp_TESTDB_cobol
macdef ftp_TESTDB_txt
macdef ftp_TESTDB_log

would always run the first macdef,

macdef TESTDB_cobol
macdef TESTDB_log
macdef TESTDB_txt

resolves the macdefs correctly.

Just in case anyone is interested.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:12 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0