During today's teleconference we discussed whether the pathname expansion ".*" should always include "." and "..". Existing practice is that if readdir() returns entries for these directories, then they are always included. However as described in http://austingroupbugs.net/view.php?id=1228 they are rarely, if ever, actually what people want.
One idea was to add a feature to the Posix shell to allow applications to control whether or not do and dot-dot are to be included ... something like this: - - set -o globskipdot - Skip the directory entries for dot and dot-dot if they are encountered when reading a directory during pathname expansion operations. It is unspecified whether the default for this option is off (unset) or on (set). If globskipdot is off and reading the directory does not provide entries for dot or dot-dot these directories shall be synthesized. Used like this: - if command set -o globskipdot 2>/dev/null - then - patterns=".* *" - else - patterns=".[!.]* ..?* *" - fi But this is pure invention on behalf of the committee ... something we don't generally like! So we would like to hear from shell implementors and others whether or not such a feature is the right way to go; would you implement it? would you use it? Feedback requested! -- Nick Stoughton ISO/IEC JTC 1/SC 22 OR