If a process runs and exits it returns a non-zero status (personnaly I prefer the term return code); or even a zero status I know that the value is there (mostly because I've done C++ programming and I know you can at the end of your
main() method return a value...but also because if I run something like:
fuser -s ./myfile.txt && echo "a process is accessing your file"
I know that the
echo only prints if the status value returned from an
fuser process is
0, if it is not,
echo is skipped all together because:
"fuser returns a non-zero return-code if none of the specified files is accessed or in case of a fatal error."
Now how do I display this return code to know it's value? Because if you're running
-silent, such as in a script, it would seem important to know the value of the return-code/status so I can tell the difference between a file that isn't being accessed and an actual fatal error.
Also, is there a common place in the man pages where return codes / status for a process are documented so I can see what the value might mean? Or is there a document that has standards for what return codes should be?