[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how to get pid when I start the process



Richard Hector wrote:
> $$ is the pid of the current shell.
> 
> $! is the pid of the most recent background process, so you could do:
> 
> amuled & echo $! > amuled.pid
> ...
> kill `cat amuled.pid`

Since presumabely amuled forks itself into the background then putting
it into the background at launch won't leave the right pid in $!.
That will be the pid of the shell but not the pid of the backgrounded
amuled.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: