-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to [EMAIL PROTECTED] 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.

- --
Life is short - so eat dessert first!

Eric Blake             [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFRLc584KuGfSFAYARAmR7AJ9Zs08Pkq0cnMT09TgAJ2u3bXqnPACfZR/B
3ovkgmMhjPShcMCrBFmDkT4=
=wvb8
-----END PGP SIGNATURE-----


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to