The syntax of the command is
So, that said, you want to see if a trap already exists in your shell. I would say that yes, one does. And it ignores SIGINT (or 2). Why it exists I can't say. You need to work on that one. So, that is why I suggest looking at all of the various login profiles you have on your box. /etc/profile, $HOME/.profile, .kshrc, or .bashrc ---- whatever.
I'm using the trap command to capture any signals received whilst my script is running.
How's the best way of writing the signal and any other error messages to a file/error log' without having to type '2>$1' on the command line after the script name?
Cheers (3 Replies)
i have the following script that displays the current time until the user presses CTR + c.... but it does not work properly....
Something is not right with the trap command...
Help plz... :confused:
# script to continuously display current time.
# if script is terminated trap signal... (3 Replies)
Dear All
could you please explain me what does the trap command do and how I can write a program which can work as a trap command(in C Language). (1 Reply)
Could anybody tell me what the trap command does and how it performs the action it does. I had read the trap manual page but it is too concise that nothing is clear about it. Please tell how it works. (1 Reply)
Hi,
I would like to know the use of TRAP command. I am very new to the UNIX environment. I have just started learning the basic. So please teach me in a very simple way to understand.
Also i would like to know the use of following command:
trap 'dialog --msgbox "Script Aborted1" 6 50 ;... (2 Replies)
Hi folks,
I have tried to add some trap detection in the below script....this script is used to monitor database activities...in a rather awkward way :rolleyes:....
The idea behind adding trap is that....this script creates lots of temporary files in the running folder to store the count... (1 Reply)
Hello experts!
I need to know the use of trap command please
In one of our program we have trap "rm -f temp1 ; exit 1" 1 2 15 0
and program always exit with 1
there is a rm -f temp1 as well at the end of the program
as
rm -f temp1
exit 0
when I test a probram with set... (4 Replies)
dear all;
I can't under stand what does "trap" command do:
for example see below:
trap "echo; echo no interrupts >&2; sleep 3" 2 3 15
Plz , can any body explain the action of this command?
BR (3 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
That is the last reply I received from my instructor, and I'm looking for some alternatives.
When using... (2 Replies)
Hi Folks -
For some reason, my trap command is not working. It's placed just prior to a normal exit:
#:: ------------------------------------------------------------------------
#::-- Script Name: LCM_Backup.sh
#::
#::-- Description: This script leverages Utility.sh to perform LCM... (16 Replies)