Announcement

Collapse
No announcement yet.

bash shell scripting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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
    command1 | command2 &
    How do I get the process id of the first command?
Working...
X