Skip to main content
4 of 4
Reverted changing to american spelling.
Dakkaron
  • 2.2k
  • 3
  • 19
  • 25

Why is nullglob not default?

In most shells nullglob isn't the default. That means, for example, if you run this command

ls *

in an empty directory, it will expand the * glob to a literal *, instead to an empty list of arguments. There are ways to change that behaviour, so that * in an empty directory will return an empty list of arguments, which would seem more intuitive.

So, is there a reason why nullglob is disabled by default? If so, what is that reason?

Dakkaron
  • 2.2k
  • 3
  • 19
  • 25