Yahoo web hosting - trapThe trapcommand is used for specifying the actions

trapThe trapcommand is used for specifying the actions to take on receipt of signals, which we ll meet inmore detail later in the book. Acommon use is to tidy up a script when it is interrupted. Historically, shells always used numbers for the signals, but new scripts should use names taken from the #includefile signal.h, with the SIGprefix omitted. To see the signal numbers and associated names, you canjust type trap -lat a command prompt. The trapcommand is passed the action to take, followed by the signal name (or names) to trap on. trapcommand signalRemember that the scripts are normally interpreted from top to bottom, so you must specify the trapcommand before the part of the script you wish to protect. To reset a trap condition to the default, simply specify the command as -. To ignore a signal, set the com- mand to the empty string . Atrapcommand with no parameters prints out the current list of trapsand actions. The following table lists the more important signals covered by the X/Open standard that can be caught(with the conventional signal number in parentheses). More details can be found under in the signalmanual pages in section 7 of the online manual (man 7 signal). SignalDescriptionHUP(1)Hang up; usually sent when a terminal goes off line, or a user logs outINT (2)Interrupt; usually sent by pressing Ctrl+CQUIT (3)Quit; usually sent by pressing Ctrl+ ABRT (6)Abort; usually sent on some serious execution errorALRM (14)Alarm; usually used for handling timeoutsTERM (15)Terminate; usually sent by the system when it s shutting down Try It Out Trapping SignalsThe following script demonstrates some simple signal handling: #!/bin/shtrap rm -f /tmp/my_tmp_file_$$ INTecho creating file /tmp/my_tmp_file_$$ date > /tmp/my_tmp_file_$$ For those not familiar with signals, they are events sent asynchronously to a program. By default, they normally cause the program to terminate. 60Chapter
Note: If you are looking for best quality webspace to host and run your tomcat application check Vision virtual web hosting services

WordPress database error: [Table 'armadillowebhosting_com_-_apache.wp_comments' doesn't exist]
SELECT * FROM wp_comments WHERE comment_post_ID = '86' AND comment_approved = '1' ORDER BY comment_date

Leave a Reply