[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Character Range Problem
From: |
Chromy, Dusan |
Subject: |
Character Range Problem |
Date: |
Thu, 7 Feb 2002 12:06:22 -0000 |
Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: solaris2.8
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='solaris2.8' -DCONF_MACHTYPE='i386-pc-solaris2.8'
-DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./include -I./lib
-g -O2
uname output: SunOS edsuit02 5.8 Generic_108529-09 i86pc i386 i86pc
Machine Type: i386-pc-solaris2.8
Bash Version: 2.05a
Patch Level: 0
Release Status: release
Description:
Hi,
the shell seems to have a problem with character ranges, like [A-Z] and
[a-z].
See the output of the script found below:
Output of ls [A-Z]*:
Annabelle
beatrice
bugreport
caseprob
Charlotte
diana
Elisabeth
fiona
Output of ls [a-z]*:
beatrice
bugreport
caseprob
Charlotte
diana
Elisabeth
fiona
I would expect the first command to list only files beginning with uppercase
and the latter with lowercase. This is how it works in ksh and also in
bash-2.05.0(1) on Sparc Sun Solaris 2.6!
It's also remarkable that Annabelle is the only file that gets listed
correctly (because its name starts with an 'A'?)
Repeat-By:
Run this script:
#!/bin/bash
echo A > Annabelle
echo b > beatrice
echo C > Charlotte
echo d > diana
echo E > Elisabeth
echo f > fiona
echo 'Output of ls [A-Z]*:'
ls [A-Z]*
echo 'Output of ls [a-z]*:'
ls [a-z]*
- Character Range Problem,
Chromy, Dusan <=