Re: shopt extquote not working

2005-09-03 Thread Chet Ramey
Enrique Perez-Terron wrote:
> Configuration Information [Automatically generated, do not change]:
> Machine: i386
> OS: linux-gnu
> Compiler: i386-redhat-linux-gcc
> Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
> -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu'
> -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
> -DSHELL -DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib  -D_GNU_SOURCE
> -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe
> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -m32 -march=i386 -mtune=pentium4
> -fasynchronous-unwind-tables
> uname output: Linux apeiron.home.lan 2.6.12-1.1398_FC4 #1 Fri Jul 15
> 00:52:32 EDT 2005 i686 i686 i386 GNU/Linux
> Machine Type: i386-redhat-linux-gnu
> 
> Bash Version: 3.0
> Patch Level: 16
> Release Status: release
> 
> Description:
> The form $'string' does not get expanded if it occurs in
> a double-quoted string even if shopt extquote is on.

That's not what extquote does.  If you read the man page, it says:

If  set,  $'string'  and  $"string" quoting is performed
within  ${parameter}  expansions  enclosed   in   double
quotes.  This option is enabled by default.

It doesn't affect double-quoted strings that don't contain
parameter expansion or $'...' expansions that occur outside
parameter expansions.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live Strong.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: Ansi-C backslash expansion: $'n' in a double-quoted string adds single-quote newline single-quote

2005-09-03 Thread Chet Ramey
Enrique Perez-Terron wrote:
> Hello,
> 
> The command
> 
>   echo "${PATH//:/$'\n'}"
> 
> yields
> 
>   /usr/bin'
>   '/bin'
>   '/usr/X11R6/bin
> 
> while
> 
>   newline=$'\n'
>   echo "${PATH//:/$newline}"
> 
> yields
> 
>   /usr/bin
>   /bin
>   /usr/X11R6/bin
> 
> Is this by intention?

It certainly doesn't seem intended if the `extquote' option is enabled.
I will take a look.  Thanks for the report.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live Strong.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/


___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash