[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] awk-ward problem



J.L. White wrote:
Hi Guys,

I'm pretty dumb with awk but I know some simple one-liner should do what I want more elegantly
than the program I wrote to do it. I just need to delete a recurring text block from a file.
The following:

awk '/Cannot connect/, /Graphics support/' testc.inp > testc.out

does exactly the opposite (ie keeps what I want to throw away and throws away what I want to keep.)
I've tried various things with != in there but I'm not getting it -- HELP!
If it's all on the one line like that a quick (but still not overly elegant!) solution would be:

cat testc,inp | sed -e 's/Cannot connect//' | sed -e 's/Graphics support//' > testc.out

- J
___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

GNU the choice of a complete generation.