News for hackers. Stuff that matters.
Re:Better bash in 15 minutes by twic on Wednesday April 16, 2014 @07:12AM (#7597067)
I set both those options in every script i write. So i do it like this:

  #! /bin/bash -eu
Because i do it in every script, readability and greppability are not important to me; i just need to apply the flags and get on with the script. Taking up two whole lines for them just adds noise.

If i was more selective in my use of those flags, then i would agree that the long forms were preferable, for the reasons given.

Re:Better bash in 15 minutes by mturmon on Wednesday April 16, 2014 @08:07PM (#7601320)
One drawback with this is that if you, or someone, does

  % bash script.sh
to run your script, then the shebang line will never be seen, and your script will run with -e off. If the "set -e" is explicitly given, this won't happen.

As you can guess, I've done this by mistake. One case is after transferring or unarchiving files where execute flags get turned off by mistake. Or using utilities, like job schedulers, that are tricky in whether they run the script as an executable, or via a shell interpreter.

Re:Better bash in 15 minutes by stormbrew on Wednesday April 16, 2014 @08:05PM (#7601316)
Does bash check the flags in the shebang if you run it with bash instead of directly?
Re:Better bash in 15 minutes by Hello71 on Wednesday April 16, 2014 @06:54PM (#7601028)
causing your script to run incorrectly as `bash script`.