r4076 - in branches/testing/BOOK: chapter01 chapter06

Anderson Lizardo lizardo at linuxfromscratch.org
Sat Sep 4 11:55:16 PDT 2004

On Thursday 02 September 2004 02:47, M.Canales.es wrote:
> El Jue 02 Sep 2004 01:44 Gerard Beekmans escrbió:
> > On Tue, 2004-08-31 at 15:29, M.Canales.es wrote:
> >> This sed expresion is very very long. For PDF output it should be
> >> reduced up to 60 chars max. If this isn't possible, then a patch should
> >> be created.
> >
> > We can use the \ shell character to break up long lines. I'll see if
> > that works.
> True for command lines, but not for sed expresions, i.e. the 's%...%...%g'
> has 75 chars.

I think this can work, too:

sed -i -e 's%^include ../MCONFIG%'\
'&\n\nCFLAGS:=$(CFLAGS) -O1%' \

which is expanded to:

sed -i -e 's%^include ../MCONFIG%''&\n\nCFLAGS:=$(CFLAGS) -O1%' 

(everything on the same line)

Note the additional single quotes (there is no double quote on this line). 
They are "merged" together into one argument, as long as there is no space 
between them. So

echo 'This is'\
' a test'

is equivalent to

echo 'This is a test'

That's why the sed line above should work.
Anderson Lizardo
lizardo at linuxfromscratch.org

More information about the lfs-book mailing list