bug-findutils
[Top][All Lists]
Advanced

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

xargs: always a background job interfering with -p


From: Dan Jacobson
Subject: xargs: always a background job interfering with -p
Date: Sat, 14 Jun 2003 10:43:42 +0800
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu)

Gentlemen, this script proves that xargs doesn't wait for the last
command to finish before prompting for the next, causing the output to
interfere with the prompting, after a "y". Find, however, doesn't have
this problem.

cd /tmp
touch a b c
find a b c -ok ls -l {} \;
echo a b c|xargs -n 1 -p ls -l

Further investigation with 'y's to:
echo 'sleep 22;echo $$' > sleepy
chmod +x sleepy
echo a b c|xargs -n 1 -p -P 1 ./sleepy

shows that not one, but two processes are allowed at one time, and -P
0, as the man page mentions, is not a remedy.

I.e. answering y to each query, there is no way to have it wait for
the first job to complete before asking about the second. -P 1 means
one background job, -P 2 means two background jobs... -P 0 means
unlimited background jobs... there is no way to make 0 background
jobs! You guys blew it.  GNU xargs version 4.1.7
-- 
http://jidanni.org/ Taiwan(04)25854780




reply via email to

[Prev in Thread] Current Thread [Next in Thread]