![]() |
|
|
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 |
| exit codes from rexec? | diego_sapphire | UNIX for Dummies Questions & Answers | 4 | 05-04-2009 12:44 PM |
| Exit Codes | cmschube | Shell Programming and Scripting | 1 | 04-04-2008 12:34 PM |
| difference b/t the exit codes $* and $@ | praveen_b744 | Shell Programming and Scripting | 1 | 09-19-2007 10:53 AM |
| Where can I find a list of exit codes? (Exit code 64) | jkuchar747 | UNIX for Dummies Questions & Answers | 3 | 12-07-2004 06:08 PM |
| exit codes | donna carter | High Level Programming | 3 | 05-31-2001 10:35 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
HI All,
I have created a unix script which takes 2 parameters and using sftp tranfers files to remote location following is the script #!/bin/ksh # # # Parameter 1 is the complete path of the destination server # Parameter 2 is the complete path of the file which is to be FTP #----------------------------------------------------------------- DEST_SERV=host@xxx.xxsftp.xx.com FTP_STR=`sftp $DEST_SERV << EOF echo $? cd $1 echo $? put $2 echo $? quit EOF` echo --- $FTP_STR i need to know the exit codes after each command is executed so tht i can trap it. My problem is tht even if the put filename or directory path is invalid the exit code is returned as "0". Can you pls help me. Thanks a lot Vikram. **************** Last edited by vikramsnest; 08-01-2007 at 08:05 PM.. |
|
||||
|
Vikram,
What you wanted to do with "FTP_STR" ? If you really looking that way as an option to get exit status then remove that back-quotes and run the sftp block as it is. After the block i.e. EOF, you can get exit-status by traditional $? In your code you always getting "0" because that status seems of FTP_STR assignment (=) |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|