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
Copying multiple folders to local machine (don't know folder names) leenyburger UNIX for Dummies Questions & Answers 5 06-12-2008 07:38 AM
multiple IP adresses on one machine scarfake UNIX for Dummies Questions & Answers 4 06-04-2008 07:11 AM
comment jobs in cron for multiple accounts shibajighosh AIX 3 04-08-2008 10:52 AM
using .netrc sveera UNIX for Advanced & Expert Users 6 03-26-2008 04:58 PM
background jobs exit status and limit the number of jobs to run GrepMe Shell Programming and Scripting 1 06-11-2007 06:56 PM

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 03-21-2002
hcclnoodles hcclnoodles is offline
Registered User
  
 

Join Date: Mar 2002
Posts: 272
.netrc multiple ftp jobs to same machine

I have an ftp user, which has been setup to run ftp jobs to a specific machine (different jobs). for the first job i created .netrc in the ftp users home directory and added the appropriate commands

machine FTPBOX01 login user1 password xxx
macdef init
etc
etc
get file
bye

I use the command 'ftp FTPBOX01' in my shell script to call the entry for that machine in my .netrc file

However, I need this user to be able to run different jobs but on the same machine , for example my .netrc file would look something like this:

machine FTPBOX01 login user1 password xxx
macdef init
etc
etc
get file
bye

machine FTPBOX01 login user2 password xxx
macdef init
etc
etc
get another file
bye


however, because i am using the 'ftp FTPBOX01' command it cant dtermine which job to run it just gets the first matching entry in .netrc (ie the top one)

How can specify from within my shell script which job i want to run, somebody has suggested that i create a different ftp user with its own .netrc file, but this is not an option as there will possibly be hundreds of jobs to the same machine

Any help on this would be greatly appreciated

Thanks and regards
Gary
  #2 (permalink)  
Old 03-21-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,119
See this post for my solution. And please get acquainted with our search function. You could have found this post yourself.
  #3 (permalink)  
Old 03-21-2002
hcclnoodles hcclnoodles is offline
Registered User
  
 

Join Date: Mar 2002
Posts: 272
Perderabo

That sounds great, i presume with this method, that everything is self contained within the script and .netrc is totally bypassed. However i am slightly confused over the following lines

exec 4>&1
ftp -nv >&4 2>&4 |&

what exactly is going on here ?

Thanks
Gary
  #4 (permalink)  
Old 03-21-2002
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,119
Scroll down a bit from that post I referenced...its all there.
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 06:40 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