Incorrect completion when quoting last component of path

2006-01-03 Thread Tim Waugh
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 -Wall 
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=pentium4 
-fasynchronous-unwind-tables
uname output: Linux gene.surrey.redhat.com 2.6.13-1.1597_FC5 #1 Thu Oct 6 
02:13:06 EDT 2005 i686 i686 i386 GNU/Linux
Machine Type: i386-redhat-linux-gnu

Bash Version: 3.1
Patch Level: 1
Release Status: release

Description:
Tab completion is wrong when completing a file path if the
last component is quoted.

Repeat-By:
rm -rf arena
mkdir arena
cd arena
mkdir d
touch d/f
ls d/'

Results: ls: d/d/f: No such file or directory

Original report:

  https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=176790

Tim.
*/


pgpoZ0Tgc9hUK.pgp
Description: PGP signature
___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


`()' subshell parsing fails in `case' clause

2006-01-03 Thread hcz
Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/lib   -g -O2
uname output: Linux tazzelwurm 2.6.14hcz1d #6 PREEMPT Thu Dec 8 11:56:38 CET 
2005 i686 GNU/Linux
Machine Type: i486-pc-linux-gnu

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

Description: 
The closing bracket in a case clause within a () subshell
gets interpreted as the subshell's closing bracket.

Repeat-By:
#!/bin/bash
x=$(
case $(ls) in
example) failsHere;;
esac
)

results in:
/bashbug.sh: line 4: syntax error near unexpected token `;;'
./bashbug.sh: line 4: `example) failsHere;;'


Fix:
move the offending code out into a function and call the
function from the subshell.


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


Correction: case and `()' subshell

2006-01-03 Thread hcz
Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I../bash -I../bash/include -I../bash/lib   -g -O2
uname output: Linux tazzelwurm 2.6.14hcz1d #6 PREEMPT Thu Dec 8 11:56:38 CET 
2005 i686 GNU/Linux
Machine Type: i486-pc-linux-gnu

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

Description: 
Just a correction:  It's about a `$()' command substitution,
not a `()' subshell, of course.  Sorry.


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


Re: Incorrect completion when quoting last component of path

2006-01-03 Thread Chet Ramey
> Machine Type: i386-redhat-linux-gnu
> 
> Bash Version: 3.1
> Patch Level: 1
> Release Status: release
> 
> Description:
>   Tab completion is wrong when completing a file path if the
>   last component is quoted.
> 
> Repeat-By:
>   rm -rf arena
>   mkdir arena
>   cd arena
>   mkdir d
>   touch d/f
>   ls d/'
> 
>   Results: ls: d/d/f: No such file or directory

Readline understands single- and double-quoted strings and uses them
as individual words to complete.  The quotes are word breaks.  This
has been the case for a very long time.

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://tiswww.tis.case.edu/~chet/


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


Re: $(case x in x)...

2006-01-03 Thread Sven Mascheck
Eric Blake in <[EMAIL PROTECTED]>:

> several platforms, including Solaris' /bin/sh, still do not
> parse ( in case patterns even today, so it is certainly
> not portable if you don't have access to a POSIX shell.

Even if they parsed it, it wouldn't be portable,
because no traditional Bourne shell knows $().

Interestingly even the traditional Almquist shell on
4BSD didn't parse it, although $() was added already.
(mainly a SVR4 sh clone and not to confuse with its
 current successors.)

(BTW, I liked your idea of testing the examples and collected
some results on http://www.in-ulm.de/~mascheck/various/cmd-subst/)
-- 
[i'm trying the list after having problems with the gateway]


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