[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: grep -C bogus
From: |
Ulrich Drepper |
Subject: |
Re: grep -C bogus |
Date: |
21 Nov 2001 13:46:03 -0800 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.5 (asparagus) |
Dan Jacobson <address@hidden> writes:
> $ man grep
> -B NUM, --before-context=NUM
> Print NUM lines of leading context before matching
> lines.
>
> -C [NUM], -NUM, --context[=NUM]
> Print NUM lines (default 2) of output context.
> $ seq 1 10|sed 5s/$/bbbb/|grep -B 1 b
> 4
> 5bbbb
> $ seq 1 10|sed 5s/$/bbbb/|grep -C 1 b
> grep: b: No such file or directory
And this is correct since the parameter for C is optional. What you want is
$ seq 1 10|sed 5s/$/bbbb/|grep -C1 b
If anything the --help text should be changed.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------
- grep -C bogus, Dan Jacobson, 2001/11/21
- Re: grep -C bogus,
Ulrich Drepper <=