Re: IFS=$'\n'

Liste des GroupesRevenir à cu shell 
Sujet : Re: IFS=$'\n'
De : naddy (at) *nospam* mips.inka.de (Christian Weisgerber)
Groupes : comp.unix.shell
Date : 14. Aug 2024, 14:59:39
Autres entêtes
Message-ID : <slrnvbpe2b.20ve.naddy@lorvorc.mips.inka.de>
References : 1 2 3
User-Agent : slrn/1.0.3 (FreeBSD)
On 2024-08-13, Ralf Damaschke <rwspam@gmx.de> wrote:

   find . -iname \*fred\* -type f -print0 |
   xargs -0 -r -x -- ls -lt --
>
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 -- {} +

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.

On BSD, that will be a syntax error because -x is only available
in combination with -n.

--
Christian "naddy" Weisgerber                          naddy@mips.inka.de

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