![]() |
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 |
| Auto copy for files from folder to folder upon instant writing | Bashar | UNIX for Advanced & Expert Users | 2 | 08-21-2008 02:44 PM |
| unzip files in a different folder | agarwalniru | UNIX for Dummies Questions & Answers | 2 | 03-25-2008 03:36 PM |
| unix C++: get the files from a folder | nadiamihu | High Level Programming | 2 | 11-29-2006 05:23 AM |
| delete all folders/files and keep only the last 10 in a folder | melanie_pfefer | Shell Programming and Scripting | 3 | 11-17-2006 03:33 PM |
| deleting files in folder | amon | Shell Programming and Scripting | 10 | 02-21-2006 10:48 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi, please correct me if there is any wrong in this script. Hope the files which are intended to be transfered are ascii files.
Code:
#!/bin/sh
result=`/usr/bin/ftp -dvin << EOF
open "$1" # IP address (or) hostname
user <username> <passwd>
lcd /home/foo/temp
cd /home/foo/cfiles
ascii
hash
bell
mput *.c
close
bye
EOF`
value=`echo "$result" | grep "226 Transfer complete" | wc -l`
[ "${value}" -ge 1 ] && { echo "$value files transferred"; exit 0; }
echo "FTP Failure"; exit 1
Last edited by royalibrahim; 10-08-2007 at 02:00 AM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|