you can also use sed to see what is matched
printf "chicken_x\nchicken_long\n" |
sed -X 's/.*chicken((_long)!).*/\1/'
On Wed, 16 Feb 2011 06:50:53 -0800 Icarus Sparry wrote:
> On 2/15/2011 10:30 PM, олÑга кÑÑжановÑÐºÐ°Ñ wrote:
> > Glenn, why does this grep line print chicken_long, despite the
> > negation operator to filter '_long"?
> >
> > printf "chicken_x\nchicken_long\n" | ./arch/linux.i386/bin/grep -X
> > 'chicken((_long)!)'
> > chicken_x
> > chicken_long
> >
> > Olga
> Negation often gives results that are not intuitive.
> I suggest you use the '-b' flag if you are on an terminal that supports
> ANSI escape sequences, in which case you will see that it matched
> "chicken_lon" (no 'g'), and then printed out the entire line. Changing
> the expression to 'chicken((_long)!)$' gives you the result you appear
> to be expecting.
> _______________________________________________
> ast-users mailing list
> [email protected]
> https://mailman.research.att.com/mailman/listinfo/ast-users
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users