bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

DEL mishandled inside double quotes


From: corey
Subject: DEL mishandled inside double quotes
Date: Wed, 16 Feb 2005 10:53:29 -0800

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' -DSHELL -DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib 
-D_FILE_OFFSET_BITS=64 -O2 -g -pipe -march=i386 -mcpu=i686
uname output: Linux futile2.cac.washington.edu 2.4.22-1.2174.nptl #1 Wed Feb 18 
16:38:32 EST 2004 i686 i686 i386 GNU/Linux
Machine Type: i386-redhat-linux-gnu

Bash Version: 2.05b
Patch Level: 0
Release Status: release

Description:

        The DEL character is mishandled in double-quoted strings.
        In the example below, the error happens in the line: T2="a $DEL".
        Old BSD and System V shells work correctly.  The bash manpage says:

           Enclosing characters in double quotes preserves the literal
           value of all characters within the quotes, with the exception
           of $, `, and \.

        So this doesn't seem to be a feature. :)

Repeat-By:

        #!/bin/sh
        DEL=`awk 'END{printf("%c", 0+127)}' </dev/null`
        T1=a\ $DEL
        T2="a $DEL"
        set x `echo $T1|wc -c` `echo $T2|wc -c`; shift
        L1=$1; L2=$2
        case "$L1/$L2" in
          4/4) echo shell ok;;
            *) echo shell bug: L1=$L1, L2=$L2;;
        esac





reply via email to

[Prev in Thread] Current Thread [Next in Thread]