Skip to content
Vidar Holen edited this page Sep 8, 2020 · 1 revision

In POSIX sh, prefixing signal names with 'SIG' is undefined.

(or "In dash, ... is not supported." when using dash)

Problematic code:

trap 'handle_interrupt' SIGINT

Correct code:

trap 'handle_interrupt' INT

Rationale:

POSIX does not allow specifying the "SIG" prefix of a signal name like "INT". Bash and Ksh supports this as an extension.

Simply remove the "SIG" from the signal name.

Exceptions:

None

Related resources:

  • Help by adding links to BashFAQ, StackOverflow, man pages, POSIX, etc!

ShellCheck

Each individual ShellCheck warning has its own wiki page like S001. Use GitHub "Pages" feature above to find a specific one, or see Checks.

Clone this wiki locally