![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to get the exit satus of a command which I executed in sftp prompt | Karteek | Shell Programming and Scripting | 2 | 04-09-2008 05:00 AM |
| exit status of command in a pipe line | topcat8 | UNIX for Dummies Questions & Answers | 10 | 10-19-2007 01:39 AM |
| Getting the exit status of a remote command | zoonalex | Shell Programming and Scripting | 1 | 08-23-2006 01:58 PM |
| Incorrect Exit Status Returned from FTP command - Help?? | frustrated1 | Shell Programming and Scripting | 3 | 08-22-2003 12:25 AM |
| How to find the exit status of last command in Unix? | rajugp1 | High Level Programming | 1 | 09-10-2002 08:52 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
how to find the exit status for the last executed command
I am executing a find command in my script i.e
find $2 -type f -name '*.gif' -mtime +$1 -exec rm {} \; how do i check that this command is executed properly.. i would lke t trap the errror and display my error message kinly help.. this is an urgent issue. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Quote:
Shells that behave like the C-Shell use the variable: $status Shells that behave like the Bourne (or Korn) shell use the variable: $? These variables are set to the exit code of the last command executed. BEWARE: in a "pipeline", the variable contains the exit code of the LAST command in the pipeline. All the other exit codes are lost. == |
||||
| Google The UNIX and Linux Forums |