Public bug reported:

Binary package hint: bash

the glob * expands to everything which does not begins with a dot
the glob .* expands to everything beginning with a dot, including . and ..

i think it is safe to say that in 99% of the cases, when someone uses
the glob .* they want to have every hidden file and directory but not .
and ..

rm -rf * #deletes everything but leaves hidden files and directories
rm -rf * .* #dangerous! also deletes everything from upper directory

that is why i think glob .* should expand to every file beginning with .
but should leave out . and .. by default.

workaround:

export GLOBIGNORE=.:..

setting GLOBIGNORE will automatically enable dotglob, which might not be
what you want. if that is the case then you must disable dotglob again.

shopt -u dotglob

this will cause * to expand to every file and directory but not hidden files 
and directories
and .* will expand to every hidden file and directory but not . and ..

using ubuntu lucid
bash version 4.1-2ubuntu3

** Affects: bash (Ubuntu)
     Importance: Undecided
         Status: New

-- 
glob .* should expand to every file beginning with . but should leave out . and 
..
https://bugs.launchpad.net/bugs/622066
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to