Over-riding TRAP in Child


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Over-riding TRAP in Child
# 1  
Old 06-23-2004
Over-riding TRAP in Child

Hi,

I'm using Ksh on HP 10.2.

My parent shell script has ignored INT signal using trap command.

trap "" 2 3 .... (other signals)

This script calls another script in which INT signal should be active and should not be ignored.

I browsed the net and found out that in ksh, once a particular signal is ignored, then subsequent trap command executed in child shells will have no effect on the disposition of signal.

Can anyone tell me how do I initialize INT signal, in my child shell, to exit from child shell, even though INT should still be ignored in my parent shell ?

Thanks in Advance....
# 2  
Old 06-23-2004
trap "exit 0" INT

And you should use the symbolic signal names rather than the numbers for maximum portability.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

VM trap may work differently than a pure install trap.

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)
Discussion started by: newuser45
2 Replies

2. Shell Programming and Scripting

forking a child process and kill its parent to show that child process has init() as its parent

Hi everyone i am very new to linux , working on bash shell. I am trying to solve the given problem 1. Create a process and then create children using fork 2. Check the Status of the application for successful running. 3. Kill all the process(threads) except parent and first child... (2 Replies)
Discussion started by: vizz_k
2 Replies

3. Homework & Coursework Questions

Need help with deleting childīs parent and child subprocess

1. The problem statement, all variables and given/known data: I need to make an program that in a loop creates one parent and five children with fork(). The problem i'm trying to solve is how to delete the parent and child of the childīs process. 2. Relevant commands, code, scripts,... (0 Replies)
Discussion started by: WhiteFace
0 Replies

4. Shell Programming and Scripting

Trap not working in orphaned child processes

I've search the various posts in these forums, but have not come up with a solution to my problem. I have a parent process that calls a child script, runs it in the background and the parent finishes - without waiting for the child process to complete. Inside the child, a trap is issued to trap... (6 Replies)
Discussion started by: HobieCoop
6 Replies

5. What is on Your Mind?

Interested in bike riding !!! share your exp..

Hi folks, i know its totally diff topic on this community ... :-) Are you interested in bike riding !!! if yes , what is your fav bike ? what bike are you having now at your home ? what is your longest ride ? I have a indian made 200cc bike .. most of the time, i... (2 Replies)
Discussion started by: vparunkumar
2 Replies

6. Shell Programming and Scripting

Cntl+z Trap is not detecting ??? Help required to add a trap detection ???

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)
Discussion started by: frozensmilz
1 Replies

7. Shell Programming and Scripting

Getting exit status of child in trap handler

Hi, I have a trap problem when calling a child script in the background. I know there are a lot of threads here on the issue of traps and signals, I think I have read all the relevant ones, but still haven't found an answer to my problem. I'm working on Linux or HP, the script as you can see... (4 Replies)
Discussion started by: rimon
4 Replies

8. UNIX for Advanced & Expert Users

Kill all child processes on trap

hi OS: Sun Solaris I have a scenario that when someone presses ctrl-c while executing a shell script, it should not just exit. it should kill all the child processes started by the running shell script only. I am executing many other scripts parallely which in turn fork off more... (2 Replies)
Discussion started by: rakeshou
2 Replies

9. Shell Programming and Scripting

Building a better mouse trap, or How many lines of code does it take to trap a mouse?

Hello all, I'm hoping to get a little insight from some of the wily veterans amongst you. I've written a script to check for new outgoing files to our vendors located on our ssl server. It seems to be working ok, but the final question here, will be one of logic, and/or a better way to... (4 Replies)
Discussion started by: mph
4 Replies

10. Shell Programming and Scripting

trap

I'd like to use "trap" command on my unix machine sunOS 5.7. But somehow when I do "which trap" command, it's no where to be found. Any one knows how I can get it installed? Thanks!! (9 Replies)
Discussion started by: whatisthis
9 Replies
Login or Register to Ask a Question