Bash - what does if [ ${?} -ne 0 ] mean?
More specifically, what does the ${?} bit mean...?
Dave |
Here, ${?} is strictly equivalent to $?, which means the return value of the last executed command.
See "man bash". Yves. |
@Yeti: it is nearly impossible to search for that in the bash man page, please forgive that user for being unable to do the impossible :P
@davee: as yeti mentioned, it's the return value of the last process executed. Usually a process returns 0 on success and a non-zero value on error so this code snippet is for checking if the last executed process was being run successfully. |
Cheers...! It's not the easiest thig to search for in google.
Dave |
Quote:
http://man.linuxquestions.org/ |
All times are GMT -5. The time now is 04:16 AM. |