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.
Exit return codes
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Re: Exit return codes
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
if [ $? -eq 0 ]; then #move files if conversion was a success
cp "/tmp/$fileName" "$folder/"
rm "/tmp/$fileName"
fi
Re: Exit return codes
Anything other than 0 is a failure.