[NTLUG:Discuss] scripting question

Bobby Sanders ssanders at ssvzc.com
Thu Apr 21 13:12:35 CDT 2011


On 04/21/2011 09:07 AM, Monty Shinn wrote:
> 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...
O'Reilly also has a book, "Learning the bash Sthell," now in its 3rd
edition.  It is probably the bash shell "Bible."

I also find "$ info bash" useful.

Bobby




More information about the Discuss mailing list