Filename brace expansion in scripts

Matthew Flaschen matthew.flaschen at gatech.edu
Thu Nov 18 18:46:40 UTC 2010


Colin Law wrote:
> I see, I don't now know where I got into the habit of putting
> usr/bin/env sh there.

That (or  #! /bin/sh) is appropriate when you want a standard (POSIX)
shell script.  If you want a bash script, use #! /bin/bash .  Generally,
you should not leave off the shebang entirely.

  Somehow I had understood that as the
> conventional thing to do.  ls -al /bin/sh shows that this is a link to
> dash.  Why does dash not do brace expansion I wonder.

Ubuntu changed /bin/sh to dash because it's significantly faster than
bash.  However, part of the cost is that it doesn't support non-standard
features like brace expansion.  See https://wiki.ubuntu.com/DashAsBinSh
for more information.

Matt Flaschen




More information about the ubuntu-users mailing list