Mar 062011

What to do if your script needs to kill all processes that it started? Just kill everything that has same parent as your current shell ($$):


kill `ps -ef | awk '$3 == '$$' {print $2}'`

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.