Top "Bash-trap" questions

Use this tag for questions about the `trap` Bash built-in.

How to trap exit code in Bash script

There're many exit points in my bash code. I need to do some clean up work on exit, so I …

bash signals exit-code bash-trap
multiple bash traps for the same signal

When I use the trap command in bash, the previous trap for the given signal is replaced. Is there a …

bash bash-trap
cp: command not found

I am trying to copy one file to other directory and getting error message while interrupt is called. The Script : #!/…

linux bash signals cp bash-trap
How to send a signal SIGINT from script to script?

I want to trap a signal send from Script-A.sh to Script-B.sh so in Script-A.sh i use the …

bash signals kill bash-trap
Is it possible to detect *which* trap signal in bash?

Possible Duplicate: Identifying received signal name in bash shell script When using something like trap func_trap INT TERM EXIT …

bash bash-trap
Trap function by passing arguments?

I've been searching everywhere and I've come to believe that there is no way to do that other than having …

bash shell signals bash-trap
How to trap exit 1 signal in Shell script?

I would like to try trapping signal 1 but fail #!/bin/bash # capture an interrupt # 0 trap 'echo "Exit 0 signal detected..."' 0 …

shell signals exit-code bash-trap
How to propagate a signal through a collection of scripts?

I have an collection of scripts which are controlled by a main one. I want to trap the signal ctrl+…

bash signals copy-paste kill bash-trap
Externally disabling signals for a Linux program

On Linux, is it possible to somehow disable signaling for programs externally... that is, without modifying their source code? Context: …

linux bash signals external bash-trap
bash trap of TERM - what am I doing wrong?

Given this hack.c program: #include <stdio.h> main() { int i=0; for(i=0; i<100; i++) { printf("%d\…

bash signals term bash-trap