![]() |
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 |
| how do I pass or read values from file ? | nix-kid | Shell Programming and Scripting | 1 | 05-20-2008 01:04 PM |
| read input file for batch job | kinmak | Shell Programming and Scripting | 14 | 07-11-2007 07:22 AM |
| pass input arguements to DB2 SQL script | mpang_ | Shell Programming and Scripting | 0 | 12-12-2006 11:27 PM |
| read/writte/input data in file. | dorek | Shell Programming and Scripting | 0 | 06-22-2006 07:31 AM |
| Read through a file and Pass system commands | systemali | Shell Programming and Scripting | 7 | 03-27-2006 03:14 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
read a file as input and pass each line to another script
Hi, I am trying to write a ftp script which will read a file for filenames and ftp those files to another server. Here's my ftp script, but it's scanning the current directory for file names.
My question is how can I pass multiple files (these files will have the name of data files that need to be ftp'd) to this script and it will read the files for file names, check if the file exists in a particular directory, ftp those files to pc2.work.com and write a log file of all the files that have been ftpd over. I would really appreceiate some assistance. Thanks.. #!/bin/sh temp="/tmp/$(basename $0).$$" ; trap "/bin/rm -f $temp" 0 targetdir="remote-dir" remote="laptop.intuitive.com" echo "taylor" > $temp echo "cd $targetdir" >> $temp for file in * do if [ -f $file ] ; then echo "put $file $file" >> $temp else echo "skipping $file: not a file." >&2 fi done echo "quit" >> $temp ftp $remote < $temp exit 0 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|