Skip to content

Files

Latest commit

 

History

History
25 lines (15 loc) · 501 Bytes

SC2172.md

File metadata and controls

25 lines (15 loc) · 501 Bytes

Pattern: Use of trap with signal number

Issue: -

Description

Signal numbers can vary between platforms. Prefer signal names, which are fixed.

Signal numbers 1, 2, 3, 6, 9, 14 and 15 are specified as parts of the optional POSIX XSI and ShellCheck will not warn about these.

Example of incorrect code:

trap somefunc 28

Example of correct code:

trap somefunc WINCH

Further Reading