[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How could you load only once a Linux ultility without a batch --input-files kind of option and repeatedly use it on many files? . . .



On Vi, 15 mai 20, 07:48:54, Greg Wooledge wrote:
> 
> Compare and contrast these commands:
> 
>  find . -type f -exec ls -l {} \;
> 
>  find . -type f -exec ls -l {} +
> 
> How do they differ?
> 
> The first one issues one "ls -l" command for each file found.
> 
> The second one gathers up multiple filenames into a list, and when it
> thinks the list is the right size, it issues one "ls -l" command with
> that entire list as arguments.  Then it repeats, until all the filenames
> have been handled.

I just stumbled upon an interesting case:

$ find po -name ro.po -exec msgfmt --statistics {} \;
66 translated messages.
705 translated messages, 14 fuzzy translations.
52 translated messages.
485 translated messages.
527 translated messages, 22 fuzzy translations, 1 untranslated message.

but

$ find po -name ro.po -exec msgfmt --statistics {} +
po/sublevel3/ro.po:21: duplicate message definition...
po/sublevel4/ro.po:19: ...this is the location of the first definition
msgfmt: found 1 fatal error

In this particular case it is actually necessary to issue a separate 
'msgfmt' command for each .po file, while in most other cases the '{} +' 
form is better (and shorter to write ;).

Kind reegards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser

Attachment: signature.asc
Description: PGP signature


Reply to: