![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| to pick up the Return Code ( RC) from the mailx command and return it to SAS uisng 's | manas6 | UNIX for Dummies Questions & Answers | 0 | 06-05-2008 03:44 AM |
| Converting Binary decimal coded values to Ascii Values | gaur.deepti | UNIX for Advanced & Expert Users | 3 | 04-02-2008 09:33 AM |
| Shell script to catch PL/SQL return values | Veera_Raghav | Shell Programming and Scripting | 0 | 06-26-2006 02:16 PM |
| perl "system" cmd return values.. | sekar sundaram | Shell Programming and Scripting | 0 | 11-24-2005 05:00 AM |
| exit/return values | vslewis | UNIX for Dummies Questions & Answers | 1 | 11-17-2004 12:12 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Possible return values for $?
I think the $? returns 0 if the last issued command was successful and otherwise if not. But does anyone knows the value list that may be returned ? (or it is only zero/one ? )
Thanks in advance, Abrahao. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
That depends on the program you have run. Return codes are usually listed in the man pages.
|
|
#3
|
|||
|
|||
|
you can get a list from
/usr/include/sys/errno.h |
|
#4
|
|||
|
|||
|
suggestion
the $? will return the exit code of the previous command executed....
the value depends on the success of the last command... 0 is always used to denote a success other values depend on the type of error.... example: in a cp command if the source file is not found, it will give a non-zero erro and if destination is not found, it will give another non-zero error value... so depending on the value returned, we can find out the error occured |
|||
| Google The UNIX and Linux Forums |