| |
GeekInterview.com > Interview Questions > Operating System > Shell Scripting
| Print | |
Question: Shell Scripting Commands
Answer: In shell scripting How to indentify that the previous command was run successfully? |
| June 06, 2009 10:21:34 |
#5 |
| sanjayojha02 |
Member Since: April 2009 Total Comments: 2 |
RE: Shell Scripting Commands |
If you want to check that your script has successfully ran. For this you have to do error handling for each command by displaying echo $?
"?" is a inbuilt variable in Shell Scripting, the value for this is assinged by shell after execution of any command to zero(success) or non-zero(failure).
so check this after each command. If somewhere it throws the unexpected values than do error handling there. |
| |
Back To Question | |