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 > Shell Programming and Scripting
.
google unix.com



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

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-17-2009
Esquizo000 Esquizo000 is offline
Registered User
  
 

Join Date: Mar 2009
Posts: 1
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!!
  #2 (permalink)  
Old 03-17-2009
JerryHone JerryHone is offline
Registered User
  
 

Join Date: Nov 2006
Location: UK
Posts: 178
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.
  #3 (permalink)  
Old 03-18-2009
wabard wabard is offline
Registered User
  
 

Join Date: Mar 2009
Location: Adelaide, SA & Perth, WA - Australia
Posts: 25
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
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 08:55 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