[UFO Chicago] Learning GNU/Sed

jjbenham@igor.chicagoguitar.com jjbenham@igor.chicagoguitar.com
Sat, 22 Jun 2002 10:02:23 -0500


I have bookmarked a couple sites that have doc's on GNU/Sed.  I was
wondering what is the best way to learn this utility.  For me learning
this stuff is easier when there is a very basic example code and then it
explains what it does.  Then it get more and more accumulative from
there. I probably just described almost every how-to. Anyway I was
wondering if there is a book or something that is clearly explained and
easy to read. 

I have been building these .ebuild bash scripts for Gentoo linux. I find
that this Sed utility can be an invaluable tool.  I only know some
basics of sed.  I have some code here and I was wondering if you guys
could tell me how to optimise the code and refer me to a how-to and or
book.

Don't laugh. Actually its okay if you do. I am not a CS major.
sed -e "/^CFLAGS/ s/-O3/${CFLAGS}/" < makefile > makefile.hacked
sed 's/\/usr\/local\/include/\/usr\/local/g' makefile.hacked > makefile.new
sed 's/\/usr\/local\/lib/\/usr\/lib/g' makefile.new > makefile
                
How can I do the same thing and make it less confusing to the reader?

Jeremiah