Loading ...
Sorry, an error occurred while loading the content.
 

Re: [PBML] Exit command

Expand Messages
  • merlyn@stonehenge.com
    ... Sreeram Thus, we have to use this in the script: Sreeram `kill -9 $PID`; where $PID is the process-ID of the terminal.. This is wrong for so many
    Message 1 of 8 , Oct 28, 2003
      >>>>> "Sreeram" == Sreeram B S <sreeramabsc@...> writes:

      Sreeram> Thus, we have to use this in the script:
      Sreeram> `kill -9 $PID`; where $PID is the process-ID of the terminal..

      This is wrong for so many reasons:

      (1) don't use `` in a void context. use system()
      (2) you didn't need to shell out anyway, since kill() is a Perl built-in!
      (3) don't send signal 9 to a process as the first signal. it gives the process
      no chance to clean up.

      So, replace that junk with something like:

      kill 15, $PID;

      Faster, better, cheaper.

      So, wherever you got that answer from, I'd distrust that source a bit
      more. If that was your brain, please learn a bit more before you
      answer other questions.

      --
      Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
      <merlyn@...> <URL:http://www.stonehenge.com/merlyn/>
      Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
      See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
    Your message has been successfully submitted and would be delivered to recipients shortly.