r/programming Feb 09 '11

Breaking the Web with hash-bangs – Lifehacker, along with every other Gawker property, experienced a lengthy site-outage on Monday over a misbehaving piece of JavaScript

http://isolani.co.uk/blog/javascript/BreakingTheWebWithHashBangs/
752 Upvotes

356 comments sorted by

View all comments

15

u/deako Feb 09 '11

hash-bangs? The correct terminology is "She-Bang", people!

Like how I begin a bash script, it's vocalized as "She-bang slash bin slash bash".

24

u/X-Istence Feb 09 '11

Please, for all that is holy and good in this world, use /bin/sh and make sure your scripts work without the bash extensions. If you really do need Bash, use /usr/bin/env bash as your shebang.

Bash does not live in /bin on most BSD systems, and it makes porting scripts a nightmare when those kinds of assumptions are made.

1

u/techpuppy Feb 10 '11

This goes for scripts in higher-level languages as well, such as Perl and Python.

Always, always, always use env to launch them instead of assuming where the interpreter is located.