Sujet : Re: IFS=$'\n'
De : rwspam (at) *nospam* gmx.de (Ralf Damaschke)
Groupes : comp.unix.shellDate : 13. Aug 2024, 23:56:56
Autres entêtes
Organisation : C.H.A.O.S.
Message-ID : <pan$989b5$e7369b52$2a19adc3$14541b89@y2plugh.fqdn.th-h.de>
References : 1 2
User-Agent : Pan/0.144 (Time is the enemy; 28ab3ba git.gnome.org/pan2)
Helmut Waitzmann wrote:
But – according to the new POSIX standard
([links to 2024 opengroup specs for find and xargs}) –
one can use “xargs“ to get rid of any linefeed trouble at all:
find . -iname \*fred\* -type f -print0 |
xargs -0 -r -x -- ls -lt --
That will work with any file names, even those containing a linefeed
character.
OK, print0 is going to become standard, but nowadays I already prefer
(when I use iname for my comfort)
find . -iname \*fred\* -type f -exec ls -lt -- {} +
I don't see any advantage using print0 and xargs -0.