Deutsch English Français Italiano |
<slrnvbpe2b.20ve.naddy@lorvorc.mips.inka.de> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder8.news.weretis.net!news.szaf.org!inka.de!mips.inka.de!.POSTED.localhost!not-for-mail From: Christian Weisgerber <naddy@mips.inka.de> Newsgroups: comp.unix.shell Subject: Re: IFS=$'\n' Date: Wed, 14 Aug 2024 13:59:39 -0000 (UTC) Message-ID: <slrnvbpe2b.20ve.naddy@lorvorc.mips.inka.de> References: <v9f5c1$3q99m$1@dont-email.me> <83a5hgad4i.fsf@helmutwaitzmann.news.arcor.de> <pan$989b5$e7369b52$2a19adc3$14541b89@y2plugh.fqdn.th-h.de> Injection-Date: Wed, 14 Aug 2024 13:59:39 -0000 (UTC) Injection-Info: lorvorc.mips.inka.de; posting-host="localhost:::1"; logging-data="66543"; mail-complaints-to="usenet@mips.inka.de" User-Agent: slrn/1.0.3 (FreeBSD) Bytes: 1658 Lines: 24 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