Skip to content

Instantly share code, notes, and snippets.

@nepsilon
Last active February 19, 2017 13:49
Show Gist options
  • Save nepsilon/ea16646e976e9f819d1f86476284bfe9 to your computer and use it in GitHub Desktop.
Save nepsilon/ea16646e976e9f819d1f86476284bfe9 to your computer and use it in GitHub Desktop.
3 bash best practices — First published in fullweb.io issue #9

3 bash best practices

Exit immediately if a command exits with a non-zero status:

set -e

Display the next command to be executed:

set -x

Use the right shebang, this is more portable than #!/bin/bash:

#!/usr/bin/env bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment