bug-bash
[Top][All Lists]
Advanced

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

Re: Spaces in args, escapes, and command substitution


From: bash
Subject: Re: Spaces in args, escapes, and command substitution
Date: Mon, 30 Oct 2006 01:18:43 +1100

>According to bash@zacglen.com on 10/29/2006 5:56 AM:
>>> This also works.
>>>
>>>  find . -exec grep -q PATTERN {} \; -exec vi {} \;
>>>
>> 
>> No it doesn't because it issues a fresh instance of vi per file.
>
>Then use the POSIX-specified:
>find . -exec grep -q PATTERN {} \; -exec vi {} +
>
>That will execute grep once per file, then aggregate the successful
>matches into a single invocation of vi (assuming you don't exceed ARG_MAX
>limits), properly accounting for spaces in filenames.
>

But, given that find is clever enough to assemble arguments containing
spaces into an arglist and feeding them to vi, why can't bash?

Regards
Bahser





reply via email to

[Prev in Thread] Current Thread [Next in Thread]