Subject: Wierd quoting constructs in sed edit strings
To: None <tech-pkg@netbsd.org>
From: Michael South <msouth@msouth.org>
List: tech-pkg
Date: 09/13/2003 01:33:30
What's the reason for this?

./audio/wmmp3/Makefile: ${SED} -e 's:/usr/local:'${LOCALBASE}':g' \

The apparently nested single-quotes were freaky, until I figured out 
that the shell was interpreting it as three concatenated strings:

     s:/usr/local:

     /usr/pkg/bin ($LOCALBASE, evaluated by make), and

     :g

=>  s:/usr/local:/usr/pkg/bin:g

It's not an attempt to put quotes around the path in the final output, 
because some packages do it to .h files, or have stuff like this:


     ./lang/fort77/Makefile:F2CPKGHASNOSHAREDLIB=    \
         -e 's:-lf2c:'${PREFIX}'/lib/libf2c.a:g'

Inquiring minds want to know...

-- 
Michael South
msouth@msouth.org