Page 1 of 1

Exit return codes

Posted: Fri Apr 20, 2018 12:07 pm
by ylafont
Description of problem or question:

Cannot seem to find proper use of how to read the exit code when processing a file in Ubuntu 16.04 LTS (CLI). Has this been document somewhere?

Thank you.

Re: Exit return codes

Posted: Fri Apr 20, 2018 12:29 pm
by ylafont
Think found the answer somewhere.. please alert if incorrect.

if [ $? -eq 0 ]; then #move files if conversion was a success
cp "/tmp/$fileName" "$folder/"
rm "/tmp/$fileName"
fi

Re: Exit return codes

Posted: Sat Apr 21, 2018 8:24 pm
by BradleyS
Anything other than 0 is a failure.