![]() |
|
|
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 |
| Major OS errors/Bash errors help!!!! | wcmmlynn | UNIX for Dummies Questions & Answers | 12 | 11-13-2007 04:50 AM |
| rcp error trapping in rsh | vvejendla | Shell Programming and Scripting | 2 | 11-21-2005 11:29 PM |
| Adapter Errors and Link Errors | mcastill66 | AIX | 2 | 08-02-2005 07:51 PM |
| Adapter Errors and Link Errors | mcastill66 | UNIX for Advanced & Expert Users | 0 | 08-02-2005 07:11 PM |
| ftp error trapping | Bab00shka | UNIX for Dummies Questions & Answers | 1 | 04-02-2002 12:21 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
trapping errors while using FTP.
Hello,
I have the following shell script to perform ftp: ftp -n $HOST<<EOD quote USER $USER quote PASS $PASS lcd $outputd cd $dir binary put *.zip quit EOD If any error is generated from this script then how to trap the error. For ex: let's say we entered wrong password then the return code from this shell script is always coming as 0. Even though there is a login error. Do anybody have an idea how to trap ftp errors? Appreciate your reply. Radhika. |
|
||||
|
Quote:
If there is any other way please advise. Thanks. Jerardfjay |
|
||||
|
Try this:
ftpresults=`ftp -inv $ip_box_name <<EOB user $userid $password put $ftp_file $downstream_name bye EOB` ftp_ctr=`echo "$ftpresults" |grep "226" | wc -l` echo $ftp_ctr if [ $ftp_ctr = 1 ] then echo "FTP of " $file_name " to " $ip_box_name " was successful" echo " " else echo="FTP failed" fi Last edited by nimo; 05-26-2005 at 07:17 PM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|