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: Sun, 29 Oct 2006 23:56:56 +1100

>> This is probably not a an optimal solution because this is late night
>> time for me but this works:
>> 
>>   eval vi $(grep -l PATTERN * | sed 's/ /\\ /')
>
>This also works.
>
>  find . -exec grep -q PATTERN {} \; -exec vi {} \;
>

No it doesn't because it issues a fresh instance of vi per file.
Not very good when you create macros and want to apply to
a set of files. Also, vi lets you navigate throught the set of
files in any order ... not possible when separate instances.

Also, find *.c would be a little more appropriate wouldn't it?

But then why not just:

        grep -l PATTERN *.c | while read f; do vi "$f"; done

This is a bash mailing list isn't it!

Regards
Bahser






reply via email to

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