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

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 behaviorbehaviour, 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?

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 behavior, 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?

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?

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

ls *

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

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

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?

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 behavior, 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?

Tweeted twitter.com/#!/StackUnix/status/601384193310986241
[Edit removed during grace period]
Link
terdon
  • 252.2k
  • 69
  • 480
  • 718
Source Link
Dakkaron
  • 2.2k
  • 3
  • 19
  • 25
Loading