![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Use of TRAP Command | Deepakh | Shell Programming and Scripting | 2 | 12-12-2006 01:24 AM |
| trap command | mobile01 | UNIX for Dummies Questions & Answers | 1 | 11-30-2006 08:54 AM |
| trap command | onlyc | UNIX for Dummies Questions & Answers | 3 | 07-11-2006 12:15 AM |
| Trap command problem | superprogrammer | Shell Programming and Scripting | 3 | 06-06-2005 06:50 AM |
| Using TRAP command | dbrundrett | Shell Programming and Scripting | 3 | 07-15-2004 06:25 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
trap command in Unix
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.
|
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
It catches a signal sent to the process. It takes action on the signal using the action defined in the trap command - instead of letting the signal take it's default effect on the process. Blocking a SIGINT signal from terminating the process, for example.
Code:
trap "echo 'interrupt singal recevied'" INT Some signals cannot be trapped (blocked is the right term) |
|||
| Google The UNIX and Linux Forums |