[PLUG] Extracting the pid - Resolved

Ross Brattain ross at principia.edu
Wed May 22 02:49:06 UTC 2002


Richard Steffens <rsteff at attbi.com> writes:

> 
> But, since this whole thing is intended to be a learning experience
> (along with providing a way to send mp3 music to my stereo), how would I
> capture the pid when I exec mpg123?
> 

In a shell $! is the PID of the last backgrounded process.
So a shell script wrapper that background mpg123 and saves $! might
work.

example:
#!/bin/bash

mpg123 $* &
echo $!


-Ross




More information about the PLUG mailing list