Broken parsing of quoted strings in backquotes

2007-08-02 Thread Martin Wheatley
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' -DLOCALEDIR='/usr/local/depot/bash-3.2/share/locale' 
-DPACKAGE='bash' -DSHELL  -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -g 
-O2
uname output: SunOS xn-sysadm-4 5.10 Generic_118833-33 sun4u sparc 
SUNW,Sun-Blade-100
Machine Type: sparc-sun-solaris2.7

Bash Version: 3.2
Patch Level: 0
Release Status: release

Description:
Parsing of quoted strings broken when string contains "# " sequence

Repeat-By:
Execution of...

OKAY:   echo "H" | sed -e 's/ /XXX/'
OKAY:   echo "H" | sed -e 's# #XXX#'

OKAY:   a=`echo "H" | sed -e 's/ /XXX/'`
FAIL:   a=`echo "H" | sed -e 's# #XXX#'`

The fault has been introduced since version 3.1.17(1)

We think this maybe related to item 31 of the COMPAT notes



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


Follow up to previous report

2007-08-02 Thread Martin Wheatley
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' -DLOCALEDIR='/usr/local/depot/bash-3.2/share/locale' 
-DPACKAGE='bash' -DSHELL  -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -g 
-O2
uname output: SunOS xn-sysadm-4 5.10 Generic_118833-33 sun4u sparc 
SUNW,Sun-Blade-100
Machine Type: sparc-sun-solaris2.7

Bash Version: 3.2
Patch Level: 0
Release Status: release

Description:
The previous report stated the problem was with embedded strings
containing "# ". We now think it is " #"

Sorry

Repeat-By:

OKAY:   a=`echo "H" | sed -e 's/H/# /'`
FAILS:  a=`echo "H" | sed -e 's/H/ #/'`


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


Re: Broken parsing of quoted strings in backquotes

2007-08-02 Thread Chet Ramey
> Machine Type: sparc-sun-solaris2.7
> 
> Bash Version: 3.2
> Patch Level: 0
> Release Status: release
> 
> Description:
>   Parsing of quoted strings broken when string contains "# " sequence

Apply the patches to bash-3.2.  Patch 1 fixed this problem.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
Live Strong.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://tiswww.tis.case.edu/~chet/


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


Re: extglob breaks when it's inside a bash function

2007-08-02 Thread Chet Ramey
> Machine Type: i486-pc-linux-gnu
> 
> Bash Version: 3.2
> Patch Level: 13
> Release Status: release
> 
> Description:
> 
> when using extglob inside a bash subshell it breaks,
> I tested it with several members in #bash and they have the same problem

This is not a bug.  Enabling the `extglob' changes the behavior of the
shell parser, since the interpretation of `(' is modified depending on
context.  Since functions are parsed when they're defined, not when
they're executed, enabling the `extglob' option inside the function
will not affect how the function is parsed.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
Live Strong.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://tiswww.tis.case.edu/~chet/


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


Re: "bashbug" script

2007-08-02 Thread Chet Ramey
> Here was an interesting bug which was some what unexpected.
> 
> cat <(find ./ -iname t{1,2,3})
> 
> this is a valid command according to bash due to a bugged expansion of
> {1,2,3} and the process expansion.  It becomes three commands:
> 
> find ./ -iname t1
> find ./ -iname t2
> find ./ -iname t3

It's not a bug.  Brace expansion is the first word expansion performed,
and can potentially expand one word to multiple ones.  If you want to
defer the brace expansion until the command in the process substitution
is executed, add a backslash before the open brace.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
Live Strong.
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://tiswww.tis.case.edu/~chet/


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