mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-10-03 19:29:44 +08:00
Add note on signal prefices
13
SC2039.md
13
SC2039.md
@@ -265,6 +265,19 @@ printf '%s' "${var}" | sed 's/some_replacement//g'
|
|||||||
|
|
||||||
No Comments / Exceptions
|
No Comments / Exceptions
|
||||||
|
|
||||||
|
### Prefixing signal names with `SIG`
|
||||||
|
|
||||||
|
Instead of e.g.:
|
||||||
|
```sh
|
||||||
|
trap my_handler SIGTERM
|
||||||
|
```
|
||||||
|
|
||||||
|
use:
|
||||||
|
```sh
|
||||||
|
trap my_handler TERM
|
||||||
|
# or (`trap -l` for a list of signal numbers):
|
||||||
|
trap my_handler 15
|
||||||
|
```
|
||||||
|
|
||||||
## Exception
|
## Exception
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user