For example, I run
sleep 1 | sleep 2 | sleep 3 &
How do I get process ids of each part? I could examine output of jobs -l but its format may wary among shells and I am looking for a simpler way.
For example, I run
sleep 1 | sleep 2 | sleep 3 &
How do I get process ids of each part? I could examine output of jobs -l but its format may wary among shells and I am looking for a simpler way.
You can use pgrep with -a option for a full listing:
pgrep -a sleep