[clug] Circumflex

Eyal Lebedinsky eyal at eyal.emu.id.au
Fri Aug 18 14:05:28 UTC 2017

On 08/18/17 23:25, Bryan Kilgallin (iiNet) via linux wrote:
> Scott:
> I have been practising, using egrep on a text file.
> "[^abc]     Not a, b, nor c"
> But I couldn't get negation working!

Can you show what is not working?

The simple expression "[^abc]" will match any line that includes at least one character
that it "Not a, b, nor c", which usually is everything line a common text file...

To test just it, use
$ echo 'a' | grep '[^abc]'
$ echo 'd' | grep '[^abc]'


Eyal Lebedinsky (eyal at eyal.emu.id.au)

More information about the linux mailing list