[NTLUG:Discuss] scripting question

Monty Shinn montys at videopost.com
Thu Apr 21 09:07:58 CDT 2011


On 04/20/2011 02:25 PM, Wayne Walker wrote:
> On Wed, Apr 20, 2011 at 02:06:26PM -0500, Fred James wrote:
<snip>
>>> Any help would be greatly appreciated.
>>>
>>> Thanks,
>>>
>>> Monty
>> Monty Shinn
>> Did you "escape" (\) the special characters (in this case the /)?
>>     s/\/usr\/test\/working\///
>> Regards
>> Fred James
>
> the s command will allow characters other than /
>
> echo "this is old crap not pig's ears" | sed -e 's/old crap/new stuff/'
> echo "this is old crap not pig's ears" | sed -e 's#old crap#new stuff#'
> echo "this is old crap not pig's ears" | sed -e 's,old crap,new stuff,'
>
> Therefore:
>
> sed -e 's#/usr/test/working/##'<  original>  cleaner
>
> Wayne
>

Thanks to all for your time and help.  Got it working.  Will try to 
incorporate it in a script now.

If anyone can point me to a good resource regarding shell scripting/etc 
that would be great.  I have O'Reilly's sed and awk book, but couldn't 
find the answer in there either.  Of course, just like Google, it helps 
when you know how to form the question...

Thanks again.

Monty



More information about the Discuss mailing list