Find the answer to your Linux question:
Results 1 to 2 of 2
i have a parent and 2 children. One of the children has a variable which the parent retrieves through a pipe. I want to set a signal handler so that ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2004
    Posts
    6

    processes & signals


    i have a parent and 2 children. One of the children has a variable which the parent retrieves through a pipe. I want to set a signal handler so that when i press ctrl + C ( SIGINT) some stats ( including the variable from the child ) are printed at the stdout.
    If the question is clear, can anyone tell me how will the processes communicate when i'll press ctrl+C so that i can, then, print?

  2. #2
    Linux Guru
    Join Date
    Mar 2003
    Location
    Wisconsin
    Posts
    1,907
    Using the trap command, you can do what you want.

    http://www.geocities.com/tipsforlinu...cles2/044.html

    Rather then kill the program, you can make it do whatever you want.

    Let us know if this helps.
    Jeremy
    Registered Linux user #346571
    "All The Dude ever wanted was his rug back" - The Dude

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •