9

On a "standard BASH" does a wildcard inside double-quotes glob? For example:

$ touch abc
$ ls "*abc*"

would that, or wouldn't that work on bash?

I was told Ubuntu shipped with a bash variant that doesn't conform to POSIX or BASH. Is that true?

Matt
  • 787

1 Answers1

9

Short answer: no

Long answer from man bash:

Enclosing characters in double quotes preserves the literal value of all characters within the quotes, with the exception of $, `, \

So:

~$ touch sas
~$ ls *a*
sas
~$ ls "*a*"
ls: cannot access *a*: No such file or directory

Of course when talking about double quotes and asterisks there is another exception: parameter expansion (ie: "$*") ...but that's another history

For the second question: are you asking about dash? dash is a lightweight shell for scripts. In debian, and in ubuntu per extension (as is debian based), is aliased to sh; It's major advantage over bash is its speed, so it is used by default for system scripts; however bash is still available as the interactive shell for users by default

 ~$ ls -l /bin/sh 
lrwxrwxrwx 1 root root 4 2011-04-21 11:54 /bin/sh -> dash
hmontoliu
  • 465