Nguyễn Ngọc Tâm Quyên
Member
How do I find exit code in Linux?
Answer
To check the exit code we can simply
print the $?
special variable in bash
. This variable will print the exit code of the last run command. As you can see after running the ./tmp.sh command the exit code was 0 which indicates success, even though the touch command failed.
Answer
To check the exit code we can simply
print the $?
special variable in bash
. This variable will print the exit code of the last run command. As you can see after running the ./tmp.sh command the exit code was 0 which indicates success, even though the touch command failed.