[SLUG] Quick question

John Allsopp john at johnallsopp.co.uk
Mon Jul 21 12:50:11 BST 2008


Al Girling wrote:
> Hi John,
>
> On Mon, Jul 14, 2008 at 08:33:06PM BST, John Allsopp wrote:
>   
>> Hope everyone's well.
>>
>> Quick question.
>>
>> In
>> sed -i 's/KoolTrax/KoolTrax™/g' *.php*
>>
>> it's ignoring the &
>>
>> Presumably it's interpreting it in some way.
>>     
>
> I suspect you're seeing KoolTraxKoolTrax#153; instead of the expected
> KoolTrax™
>
>   
>> How do I make it treat the & like the other characters?
>>     
>
> You need to escape the '&' with a backslash like:
>
> sed -i 's/KoolTrax/KoolTrax\™/g' *.php*
>   

Thanks Al, sadly that's not working for me. I wonder if my Fedora 6(?) 
setup is different somehow. The man page backs you up, and I'm just 
wading through the info page, but what that command is doing is 
replacing KoolTrax with KoolTraxKoolTrax#153; , ie. it's ignoring the \ 
and doing the & thing anyway.

Any thoughts?

J




More information about the Scarborough mailing list