Phoronix Forums  

Go Back   Phoronix Forums > Software > General Linux

General Linux Discuss anything GNU/Linux related that doesn't fit into any of the other areas.

Reply
 
Thread Tools Display Modes
  #1  
Old 11-03-2006, 02:41 AM
shinytoaster shinytoaster is offline
Junior Member
 
Join Date: Oct 2006
Posts: 6
Default bash shell scripting

$! gives you the pid of the last run process. You often see it used to log the process id to a file like
Quote:
echo $! > programname.pid
If you are piping one command to another then $! will give you the process id of the second command since it is the last. As in
Quote:
command1 | command2 &
How do I get the process id of the first command?
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 12:17 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2009 by Phoronix Media.