Pattern: Malformed exit
Issue: -
exit
can only be used to signal success or failure (0 = success, 1-255 = failure). It can not be used to return string data, and it can not be used to print error messages.
String data should be written stdout, before an exit 0
to exit with success.
Example of incorrect code:
exit "Bad filename"
Example of correct code:
echo "Bad filename" >&2
exit 1