![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| script to change passwords for the same user on multiple servers | stolz | Shell Programming and Scripting | 7 | 02-17-2009 03:49 PM |
| Script to SCP a file to multiple servers | rdlover | Shell Programming and Scripting | 7 | 02-15-2009 05:12 PM |
| rsh to change multiple ip in multiple servers? | kenshinhimura | Shell Programming and Scripting | 2 | 02-18-2008 03:04 AM |
| login into multiple servers thru script... | avcert1998 | Shell Programming and Scripting | 1 | 09-09-2005 03:38 AM |
| ftp to multiple servers | kristy | Shell Programming and Scripting | 2 | 12-03-2001 03:49 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Script ftp multiple servers
Hi guys , i have 1 problem and no find what is the problem...
, and .netrc is configured and correct permissions...REMOTE="/home/user" LISTADO=`cat /root/home/user/LISTADO.txt` MACHINE=$(echo $i|awk 'FS="|" {print $1}') for i in $LISTADO do ftp $MACHINE <<TER passive prompt cd $REMOTE mget *.html bye TER done Thx in advance!! |
|
||||
|
Well you haven't actually said what your problem is, but at a guess, the script is totally confused!
Your line to determine MACHINE uses $i which is not set outside the for loop. Move the "MACHINE=" line into the loop. |
|
||||
|
I am also confused, however, this may (or may not) be of some use...
Code:
#!/bin/sh
REMOTE="/home/user"
LISTFILE=/root/home/user/LISTADO.txt
for i in `cat $LISTFILE | awk -F\| '{ print $1 } '`
do
ftp $i <<!
passive
prompt
cd $REMOTE
mget *.html
bye
!
done
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|