Andriy Sen hotmail.com> writes:
> G:\>cat test.s | grep -P "^(|[^0])1"
> 1
Useless use of cat. It is more efficient to write:
grep -P "^(|[^0])1" test.s
--
Eric Blake
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
This is not cygwin-specific, so it is really OT for this list, that
being said...
Sorry. I will try to figure out where to go then.
grep -P treats the whole input as a single string, and outputs the
line (or lines) containing the match for the pattern. [^0] matches
ANYTHING except 0, inc
Den 2009-03-03 19:26 skrev Andriy Sen:
Below is an example of the problem.
G:\>grep -V
GNU grep 2.5.3
Copyright (C) 1988, 1992-2002, 2004, 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or F
Andriy Sen wrote:
> Below is an example of the problem.
>
> G:\>cat test.s
> a
> 1
>
> G:\>cat test.s | grep -P "[^0]1"
> a
> 1
This is not cygwin-specific, so it is really OT for this list, that
being said...
grep -P treats the whole input as a single string, and outputs the
line (or lines) con
4 matches
Mail list logo