Skip to content

Latest commit

 

History

History
27 lines (17 loc) · 518 Bytes

SC2241.md

File metadata and controls

27 lines (17 loc) · 518 Bytes

Pattern: Malformed exit arguments

Issue: -

Description

In bash, exit can only be used to signal success or failure (0 = success, 1-255 = failure).

To exit with textual or multiple values from a function, write them to stdout and capture them with command substitution instead.

Example of incorrect code:

exit one two

Example of correct code:

echo one
echo two
exit

Further Reading