sed string replacements

Scott Haneda talklists at newgeo.com
Sat Jun 19 13:57:11 PDT 2010


On Jun 19, 2010, at 12:39 PM, Joshua Root wrote:

> On 2010-6-20 05:30 , Rainer Müller wrote:
>> On 2010-06-19 21:05 , Scott Haneda wrote:
>>>    sed -e '/_VERSION_HEADER_/$VERSION_HEADER' DOCUMENTATION
>>>    sed -e '/_TOKEN_/$DOWNLOAD' DOCUMENTATION
>>>    sed -e '/_OTHER_TOKEN_/$ALT_DOWNLOAD' DOCUMENTATION
>>              ^
>> 
>> You would need:
>>      sed -e 's/_VERSION_HEADER_/$VERSION_HEADER/' DOCUMENTATION
> 
> Using single quotes here is also going to stop the variables from being
> substituted

Thanks.  Well, at least it is not just me that is getting stuck on this one.  I have tried the above, with ' and with " to no promising results.

    $cat maker 
    #!/bin/bash
    VERSION_HEADER=`cat VERSION.header`
    #echo "$VERSION_HEADER"
    
    sed -e "s/_VERSION_HEADER_/$VERSION_HEADER/" DOCUMENTATION

$./maker 
sed: 1: "s/_VERSION_HEADER_/# Hi ...": unescaped newline inside substitute pattern

Here is a quick snap of the files so you can see what I am up to at a glance:
http://dl.dropbox.com/u/340087/drops/06.19.10/ss-2010-06-19_1.56.01%20PM-087b6392-135645.png

Thanks
-- 
Scott * If you contact me off list replace talklists@ with scott@ * 



More information about the macports-dev mailing list