bash character ranges have unexpected behavior with certain locales
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
i am going through the process of upgrading my Jollicloud-powered netbook to Ubuntu 10.4 netbook edition...
i unfortunately cannot paste the console session here, but here's what i did:
mount /dev/sda5 /mnt (an ext3 filesystem, my old root directory)
cd /mnt
ls
(list of dirs from '/' of the older installation)
mv home HOME
rm -fr [a-z]*
It deleted not only [a-z]*, but [a-zA-Z]*, which is contrary to my 15+ years of Unix use and every piece of documentation regarding shell patterns and case-sensitive filesystems like this one (ext3). So it just wiped out my old home directory entirely, along with 30GB of data which i will now have to re-fish out of various SVN repos and Dropbox. (The point of the 'mv' was to keep me from having to re-sync the 15GB of Dropbox data.)
To reproduce the problem:
1) Boot from the live edition (i don't yet know if it affects the "normal" install, and if it does millions of shell scripts around the world are going to start hosing data).
2) Open a terminal
3) Type:
touch XYZ
rm [a-z]*
that removes XYZ along with everything else, which is just plain wrong.
>:-(
The same thing here:
touch XYZ
ls [a-z]*
includes XYZ in the listing, which implies that some Unix-noob a&&hole thoughtlessly enabled a shell option which makes bash do case-insensitive wildcard expansion. (Again, contrary to every other Unix system/ configuration i've every worked on.)
>:-(