Re: escaping exclamation in double quoted string

2007-07-28 Thread Andreas Schwab
[EMAIL PROTECTED] (Bob Proulx) writes: > John Tromp wrote: >> The idea of "escaping" a '!' with a backslash is rather lost if the >> escaping character shows through. Wouldn't it be more useful to >> remove the backslash? Now, when I want to echo the 3 characters >> '!', I have to do something li

Re: escaping exclamation in double quoted string

2007-07-28 Thread Bob Proulx
Please keep replies to the mailing list so that others can participate in the discussion and any answers will be archived. Thanks. John Tromp wrote: > That is perfectly clear! > > However, the question remains: what is the rationale of that specification? I was not part of the decision and can

Re: escaping exclamation in double quoted string

2007-07-27 Thread Bob Proulx
John Tromp wrote: > echo "hi\!" still shows the backslash Thank you for your report. However this is intended behavior. And it is also documented! :-) man bash Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception

escaping exclamation in double quoted string

2007-07-27 Thread John Tromp
Configuration Information [Automatically generated, do not change]: Machine: sparc OS: solaris2.7 Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='sparc' -DCONF_OSTYPE='solaris2.7' -DCONF_MACHTYPE='sparc-sun-solaris2.7' -DCONF_VENDOR='sun' -DSHELL -DHAVE_CONFIG_H -D_LARGEFILE