diff options
Diffstat (limited to 'bash.html.markdown')
-rw-r--r-- | bash.html.markdown | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bash.html.markdown b/bash.html.markdown index 02d7f31e..c2c3e3f1 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -272,6 +272,9 @@ grep -c "^foo.*bar$" file.txt # and not the regex, use fgrep (or grep -F) fgrep "foobar" file.txt +# trap command allows you to execute a command when a signal is received by your script. +# Here trap command will execute rm if any one of the three listed signals is received. +trap "rm $TEMP_FILE; exit" SIGHUP SIGINT SIGTERM # Read Bash shell builtins documentation with the bash 'help' builtin: help |