Rodrigo Barbosa wrote:
On Tue, Aug 28, 2007 at 10:31:08AM -0400, Scott McClanahan wrote:
On Tue, 2007-08-28 at 10:27 -0400, Stephen Harris wrote:
$ sed '/bar/,+5d' xx line 1 line 2 line after 6 line after 7
Beautiful man! Hats off. I've never used sed like that but I'll surely remember that one. Thanks from everybody.
"sed" is a very nice tool. You can do amazing things with it. I once did a XML to HTML (limited) parser in it. I know someone that even coded a "Sokoban"-like game with sed and nothing else. Mastering sed really makes life much easier.
If sed had been invented first we wouldn't have needed grep. Then again, if perl had been invented first we wouldn't need either - or a few hundred other tools...
Ick. I hate perl.
It's easy to hate perl that other people have written, but you can write your own in whatever style you like.
If I find something I can't do in bash/sed/awk, I just code it in C :)
You can write perl that looks like C - but if you aren't using hashes and regexps you'll do a lot more work. And pretty much everything that anyone might need to do has already been written and is available on CPAN.