olivier
Developer
Hi all,
I've got a problem with sh/tcsh jobs output. My simple goal is to get the number of running jobs, like in this example:
But the output is not what I'm waiting for: Only "3" in this example, but this:
The output of jobs is not sent to wc.
I need to use a very dirty hack for my needs:
Did someone know how to avoid the use of a temporary file for counting jobs number in sh or tcsh?
Thanks
I've got a problem with sh/tcsh jobs output. My simple goal is to get the number of running jobs, like in this example:
Code:
sleep 5 & ; sleep 5 & ; sleep 5 & ; jobs | wc -l
But the output is not what I'm waiting for: Only "3" in this example, but this:
Code:
[1] 75677
[2] 75678
[3] 75679
0
I need to use a very dirty hack for my needs:
Code:
sleep 5 & ; sleep 5 & ; sleep 5 & ; jobs > tempofile
wc -l tempofile | tr -s " " | cut -f 2 -d " "
Did someone know how to avoid the use of a temporary file for counting jobs number in sh or tcsh?
Thanks