bug-findutils
[Top][All Lists]
Advanced

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

[bug #61009] xargs need option to immediately stop on command fail


From: Geoff Clare
Subject: [bug #61009] xargs need option to immediately stop on command fail
Date: Wed, 11 Aug 2021 06:38:24 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36

Follow-up Comment #9, bug #61009 (project findutils):

[comment #5 comment #5:]

> find . -type f \( -exec cp -t "${IMGDIR_DST}" {} + -o -quit \)

That will never evaluate -quit because -exec ... {} + is always true, as
required by POSIX. (With the '+' terminator, command failure is communicated
via find's exit status instead.)

$ find --version 2>&1 | head -n 1
find (GNU findutils) 4.6.0.225-235f
$ find . -type d \( -exec sh -c 'exit 1' {} + -o -print \)
$ echo $?
1
$ find . -type d \( -exec sh -c 'exit 1' {} \; -o -print \)
.
$ echo $?
0


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61009>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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