[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep bug
From: |
Eric Blake |
Subject: |
Re: grep bug |
Date: |
Thu, 29 Jun 2006 06:19:43 -0600 |
User-agent: |
Thunderbird 1.5.0.4 (Windows/20060516) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Paul Jarc on 6/28/2006 10:29 AM:
> Lars Ångman <address@hidden> wrote:
>> grep "-b" foo.bar
>>
>> the command hangs, i.e. I never get back to the promt.
>
> -b is interpreted as an option, and foo.bar is interpreted as the
> pattern to search for. Since no apparent filename is given, grep
> reads stdin.
>
> You can use "grep -e regexp" to search for a pattern that starts with
> "-". That will stop the pattern from being interpreted as options.
Or, keeping in the tradition of most POSIX apps, use -- as the separator
between options and arguments.
grep -- -b foo.bar
- --
Life is short - so eat dessert first!
Eric Blake address@hidden
-----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
iD8DBQFEo8Vf84KuGfSFAYARAvZ1AKCjPSG3RlB/x1EY7c8mdpF6MAELmgCfWWCW
HnSvDvOOH/ggWOvqpfMojQg=
=5etW
-----END PGP SIGNATURE-----