bug-bash
[Top][All Lists]
Advanced

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

bug in bash v2.05b


From: Philippe Berthault
Subject: bug in bash v2.05b
Date: Thu, 5 Dec 2002 14:45:12 +0100

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  -I.  -I. -I./include -I./lib -D_GNU_SOURCE  -O2 -march=i386 -mcpu=i686
uname output: Linux frcls2015 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 i686 i386 GNU/Linux
Machine Type: i686-pc-linux-gnu
 
Bash Version: 2.05b
Patch Level: 0
Release Status: release
 
Description:
=========
   The '[x-y]' sequence doesn't work correctly.
 
Repeat-By:
========
   In my home directory, the "ls -d [a-z]*" command, returns all files, even those written in upper-case.
   The "ls -d [A-Z]*" command returns all files, excepted the first one.
 
Script example:
===========
  cd $HOME
  ls -d *
  # returns:
  # archives  bin  Desktop  ffjuser40ce  lib  man  tmp  work
  ls -d [a-z]*
  # return
  # archives  bin  Desktop  ffjuser40ce  lib  man  tmp  work
  # It's FALSE
 
  ls -d [A-Z]*
  # returns:
  # bin  Desktop  ffjuser40ce  lib  man  tmp  work
  # It's FALSE
 
  ls -d [abcdefghijklmnopqrstuvwxyz]*
  # returns:
  # archives  bin  ffjuser40ce  lib  man  tmp  work
  # It's OK
 
  ls -d [ABCDEFGHIJKLMNOPQRSTUVWXYZ]*
  # returns:
  # Desktop
  # It's OK
 
  for file in *
  do case "$file" in
     [a-z]*) echo "$file : lower case";;
     [A-Z]*) echo "$file : UPPER CASE";;
       esac
  done
  # returns:
  # archives : lower case
  # bin : lower case
  # Desktop : lower case
  # ffjuser40ce : lower case
  # lib : lower case
  # man : lower case
  # tmp : lower case
  # work : lower case
  for file in *
  do case "$file" in
     [A-Z]*) echo "$file : UPPER CASE";;
     [a-z]*) echo "$file : lower case";;
      esac
  done
  # returns:
  # archives : lower case
  # bin : UPPER CASE
  # Desktop : UPPER CASE
  # ffjuser40ce : UPPER CASE
  # lib : UPPER CASE
  # man : UPPER CASE
  # tmp : UPPER CASE
  # work : UPPER CASE

reply via email to

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