> > > jobs -p %x
> 
> > Does the %NUMBER bit work the same in scripts?
> 
> Yes, if you enable job control (aka monitor mode).

Ah, thanks for that - pretty well hidden in the docs though. One would
have to know what it's called.

> I'm
> not sure it's a good idea to use job control in scripts, but it can be
> done.

It seems to be linked tightly with the terminal the script was started
from. If the shell running the script creates its own pseudy tty, it
should work. A reasonably good test would be to see if it works when run
from cron.

> > How do I get the exit code of those processes?
> 
> In bash, use the PIPESTATUS array once the pipeline exits.

Goodiegoodiegoodiegood, thanks for that. Reading the bash manual N times
obviously isn't good enough to pick up all the content ;))

Now I guess we want a PIPEPID...

Volker

-- 
Volker Kuhlmann                 is possibly list0570 with the domain in header
http://volker.dnsalias.net/             Please do not CC list postings to me.

Reply via email to