Sujet : Re: IFS=$'\n'
De : rwspam (at) *nospam* gmx.de (Ralf Damaschke)
Groupes : comp.unix.shellDate : 14. Aug 2024, 23:55:40
Autres entêtes
Organisation : C.H.A.O.S.
Message-ID : <pan$2d437$c79a548c$945396fd$527603cd@y2plugh.fqdn.th-h.de>
References : 1 2 3 4
User-Agent : Pan/0.144 (Time is the enemy; 28ab3ba git.gnome.org/pan2)
Christian Weisgerber wrote:
If sufficiently many files accrue, find(1) will invoke ls(1) several
times, which will not produce the expected result. That may be unlikely
in this specific example, but it can happen in the general case.
Wait, you say, xargs(1) will also split its input across multiple
invocations. I mean, that's very much the point of xargs. Which is why
Helmut added the -x flag, which is supposed to prevent this behavior.
I see the point, but I hope I never meet a use case that says
"do something with the files found, but throw the list away if it can't
be done all at once". I would rather first assemble the list, try to execute
the command with it and if needed switch to some different approach of
handling the files.