bug-bash
[Top][All Lists]
Advanced

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

Subshells and shellscripts do not always expand [a-z] to


From: jeg
Subject: Subshells and shellscripts do not always expand [a-z] to
Date: Mon, 2 Dec 2002 23:38:14 -0500

only lower-case characters

Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -D_GNU_SOURCE  -I.  -I. -I./include 
-I./lib -O2 -march=i386 -mcpu=i686
uname output: Linux quilla.princeton.edu 2.4.18-3bigmem #1 SMP Thu Apr 18 
07:17:10 EDT 2002 i686 unknown
Machine Type: i686-pc-linux-gnu

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

Description:
    Consider the following two shellscripts:

dote2:

#!/bin/sh
echo .[a-z]*

and

dote3:

echo .[a-z]*

under bash 1.14.7(1), the version distributed with RH 7.2, all
combinations of simple invocations of dote2, dote3, . dote2, . dote3,
'echo .[a-z]*' from the shell prompt, and 'bash -c 'echo .[a-z]*' '
from the shell prompt return the correct answer--all the
lower-case dotfiles. (assuming you sit in $HOME)


under bash 2.05a.0(1), the version distributed with RH 7.3, dote3, .
dote3, . dote2, and `echo .[a-z]*` from the shell prompt all return the
correct answer, but the invocation of dote2 from the command line or the
statement 'bash -c 'echo .[a-z]*' ' from the command line returns ALL
dotfiles of BOTH cases. Which is very curious, because

ls -l /bin/sh returns

lrwxrwxrwx    1 root     root            4 Oct  4  2028 /bin/sh -> bash*




Repeat-By:
    Follow the above procedure  





reply via email to

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