Hi!

----

While working on another project I hit a problem with obtaining the
process ID of the current child process (I'd like to "renice" it to a
lower priority (however in a different way than the "bgnice" option
does)).

Example:
-- snip --
$ (ksh93 -c 'px() { echo "p1=${$} p2=${!}" ; } ; px ; ( px ) &')
p1=27961 p2=
p1=27961 p2=
-- snip --
The output of $$ is expected... but how can I get the process ID of the
current child process ?

For comparisation "bash" returns the current background process ID in $!
_within_ the child:
-- snip --
$ (bash -c 'px() { echo "p1=${$} p2=${!}" ; } ; px ; ( px ) &')
p1=27964 p2=
p1=27964 p2=27965
-- snip --

I am not sure whether this behaviour is POSIX conformant... but it is
IMO usefull...

... any ideas/suggestions/rants/etc. welcome...

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.mainz at nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 7950090
 (;O/ \/ \O;)

Reply via email to