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

2021-08-11 Thread Geoff Clare
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

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

2021-08-10 Thread anonymous
Follow-up Comment #8, bug #61009 (project findutils): [comment #7 comment #7:] > The idiom 'find -type f | xargs -IX cp X ...' is per se unsafe: > `xargs -I` reads the input line by line - but yes, files can > have a newline in their name! > Alternatively, use 'find ... -print0 | xargs -0 ...'

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

2021-08-10 Thread Bernhard Voelker
Follow-up Comment #7, bug #61009 (project findutils): >> find . -type f | xargs -F -IX -n1 cp -f X $IMGDIR_DST/X >> >> I can't find any problem with unsafe filenames. Am i wrong? Yes: The idiom 'find -type f | xargs -IX cp X ...' is per se unsafe: `xargs -I` reads the input line by line - but

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

2021-08-09 Thread anonymous
Follow-up Comment #6, bug #61009 (project findutils): [comment #5 comment #5:] > Sorry, that had an obvious bug, here's a fix: > > find . -type f \( -exec cp -t "${IMGDIR_DST}" {} + -o -quit \) IMHO, this isn't _less_complex_ :-). There are: - \( \) - \+ - -o -quit This is complex. There are

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

2021-08-07 Thread James Youngman
Follow-up Comment #4, bug #61009 (project findutils): The proposed find . -type f | xargs -IX -n1 sh -c "cp -f X $IMGDIR_DST/X || exit 255" || exit 1 can be implemented more efficiently without using the hypothetical -F flag: find . -type f -exec cp -t "${IMGDIR_DST}" {} + -o -quit This

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

2021-08-05 Thread anonymous
Follow-up Comment #3, bug #61009 (project findutils): > This is my guess because the shown use of find/xargs > is quite excessive (one cp(1) invocation per file) and unsafe (unusual filenames > would break the construct). About unsafe filenames. If you talk about this: find . -type f | xargs

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

2021-08-05 Thread anonymous
Follow-up Comment #2, bug #61009 (project findutils): [comment #1 comment #1:] > POSIX [1] specifies the following conditions when xargs shall terminate processing: > * child exits with 255, > * child was killed by a signal, or > * when reading the 'eofstr' string if the '-E eofstr' option is

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

2021-08-04 Thread Bernhard Voelker
Update of bug #61009 (project findutils): Assigned to:None => berny ___ Follow-up Comment #1: I have to confess that I like the idea of having an option to immediately stop processing

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

2021-08-04 Thread anonymous
URL: Summary: xargs need option to immediately stop on command fail Project: findutils Submitted by: None Submitted on: Wed 04 Aug 2021 08:50:38 AM UTC Category: xargs