patches vs sed

Greg Schafer gschafer at zip.com.au
Fri Sep 20 23:26:00 PDT 2002


Hi

Just an observation really.

Typing in sed expressions is fiddly and error prone. I used to hate the
copious amount of seds that were in the book at one stage. It was like
there was some sort of competition to see who could write the most
complicated sed statement! I was so glad when the decision was made to
replace most of the seds with patches.

Simple seds are fine.
Complex seds should be replaced with patches.

What prompted me to write this was the latest man commands:-

sed -e '/^PAGER/s/-is/-isR/' \
    -e 's%MANPATH[[:space:]]/usr/man%#MANPATH /usr/man%' \
    src/man.conf.backup > src/man.conf &&

That is bordering on complex and could likely be replaced with a patch.

Just MHO of course.

Greg
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-dev' in the subject header of the message



More information about the lfs-dev mailing list