Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

14
  • 36
    Somebody once made a bad choice that turned into "we've always done it this way". A very ubiquitous phenomenon (not only) in the software world. Commented May 21, 2015 at 12:27
  • 6
    The original reason is that the nullglob option didn't exist back then. So to maintain backwards compatibility it must be disabled by default. Commented May 21, 2015 at 12:48
  • 3
    While it does not specifically mention the null glob, some history on globbing is provided by this answer: unix.stackexchange.com/a/136409/22724 Commented May 21, 2015 at 13:10
  • 4
    I get the impression some think it should be obvious that nullglob should be enabled by default. I don't think it's obvious. That expansions happen in the shell before command invocation means that expanding to nothing is a less intuitive behavior than the glob remaining unchanged. Commented May 21, 2015 at 16:32
  • 4
    @kojiro Less intuitive to whom? Anyone with any familiarity with *NIX shells knows that * is a glob and expands to all existing files; how is it "intuitive" for there to be a special case where empty directory globs are "expanded" to a literal *? Commented Jul 5, 2016 at 15:53