On Wed, Feb 16, 2011 at 3:50 PM, Icarus Sparry <[email protected]> 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 > > 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'),
Somehow this feels wrong. Glenn: Does ! always only match one single character, even if ! is precended by a bracket pair (e.g. "(foo)!") ? > and then printed out the entire line. Changing > the expression to 'chicken((_long)!)$' gives you the result you appear > to be expecting. Erm... can anyone explain in detail why grep -X works this way in detail, please ? ---- Bye, Roland -- __ . . __ (o.\ \/ /.o) [email protected] \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer /O /==\ O\ TEL +49 641 3992797 (;O/ \/ \O;) _______________________________________________ ast-users mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-users
