Re: IFS=$'\n'

Liste des GroupesRevenir à cu shell 
Sujet : Re: IFS=$'\n'
De : rwspam (at) *nospam* gmx.de (Ralf Damaschke)
Groupes : comp.unix.shell
Date : 13. Aug 2024, 22: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.

Date Sujet#  Auteur
13 Aug 24 * IFS=$'\n'8Lawrence D'Oliveiro
13 Aug 24 `* Re: IFS=$'\n'7Helmut Waitzmann
13 Aug 24  `* Re: IFS=$'\n'6Ralf Damaschke
14 Aug 24   +- Re: IFS=$'\n'1Lawrence D'Oliveiro
14 Aug 24   `* Re: IFS=$'\n'4Christian Weisgerber
15 Aug 24    +* Re: IFS=$'\n'2Ralf Damaschke
15 Aug 24    i`- Re: IFS=$'\n'1Ed Morton
15 Aug 24    `- xargs -x (was: IFS=$'\n')1Geoff Clare

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal