mirror of
git://git.sv.gnu.org/findutils.git
synced 2026-01-31 05:38:59 +01:00
In interactive mode, there is a race between xargs prompting about the next command to be run, vs. the execution of the echo command: $ echo 1 2 | xargs -n 1 -p /bin/echo 1 ?...y /bin/echo 2 ?...1 y 2 This behavior violates POSIX: (http://pubs.opengroup.org/onlinepubs/9699919799/utilities/xargs.html): The xargs utility shall then invoke the constructed command line and wait for its completion. This sequence shall be repeated until one of the following occurs: [...] * xargs/xargs.c (xargs_do_exec): Move the code for waiting for forked processes up, so that the child process terminates before we prompt for the next command. * NEWS: Mention the fix. Reported by jidanni@jidanni.org in http://lists.gnu.org/archive/html/bug-findutils/2013-07/msg00015.html