tech-userlevel archive

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

Re: $$ broken??



On Mon, Mar 25, 2013 at 01:22:05AM -0400, Mouse wrote:
> 
> Perhaps more importantly, what can I do to fix it?  Failing that, is
> there some other tool I can use to give me the correct PID as a
> workaround?

Try:
$ pid=$(sh -c 'ps -oppid -p $$')
$ pid=${pid#PPID }

Although some old versions of sh don't like the space in that pattern.

        David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index