It just works that way <G>.  Each level will process special characters so 
if you just have the shell that's one level.  Scripts, etc. require 
additional characters for escaping since some of the characters are 
stripped before they get it.

Or something like this.  I used to know the technical explanation in detail 
but I do remember you sometimes have to add additional escape characters.


Joel Hammer wrote:

> This works:
> CURRENT_TEST1=`echo ${CURRENT_TEST} | sed 's/\ /\\\ /'`
> 
> Don't ask me why. I would guest that the \ is signaling to the shell
> to use the special meaning of the next character, which isn't special,
> so it is just dropped. Why the command line behaves differently from
> the script is one of those mysteries of life.
> 
> Joel
> 
> 
> 
> On Sat, May 31, 2003 at 10:29:09PM -0000, skeeterhawkca wrote:
>> I can do the following on the command line:
>> 
>> CURRENT_TEST="The Test"
>> 
>> echo ${CURRENT_TEST} | sed 's/\ /\\ /'
>> 
>> which produces
>> 
>> The\ Test
>> 
>> Which is what I am looking to do in a shell script. (bash)
>> 
>> So if added the following to my shell:
>> 
>> CURRENT_TEST1=`echo ${CURRENT_TEST} | sed 's/\ /\\ /'`
>> 
>> But I only get this (with the echo ${CURRENT_TEST1} script command)
>> 
>> The Test
>> 
>> Any help would be great.
>> 
>> Phil
>> 
>> 
>> ------------------------ Yahoo! Groups Sponsor ---------------------~-->
>> Get A Free Psychic Reading! Your Online Answer To Life's Important
>> Questions. http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/dkFolB/TM
>> ---------------------------------------------------------------------~->
>> 
>>  
>> 
>> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>> 
>>

-- 
Brett I. Holcomb
[EMAIL PROTECTED]
AKA Grunt <><
Registered Linux User #188143
Remove R777 to email
_______________________________________________
Linux-users mailing list
[EMAIL PROTECTED]
Unsubscribe/Suspend/Etc -> http://www.linux-sxs.org/mailman/listinfo/linux-users

Reply via email to