patches vs sed

Matthias Benkmann matthias at winterdrache.de
Sat Sep 21 03:33:07 PDT 2002


On Sat, 21 Sep 2002 16:26:00 +1000 Greg Schafer <gschafer at zip.com.au>
wrote:

> 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.

MHO2, but can't the 2nd sed expression be simplified to something like

s%^\(MANPATH.*/usr/man\)%#\1%

Of course, this is way less explicit but if readability is the issue, no
sed is better than a unified diff.

MSB

-- 
Who is this General Failure,
and why is he reading my disk ?

-- 
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