Bash

#!/usr/bin/env bash

set -o pipefail

# ...

Bash Strict Mode:

  • set -o errexit - halt on error
  • set -o nounset - halt if variable is unset
  • set -o pipefail - halt if command inside pipe failed

Bash ENV interpolations

  • "$FOO"
  • "${FOO}"
  • set -u raise error for undefined referenced variable

Double Quotes

for i in $(seq 1 10); do bundle exec ruby test/test_puma_server.rb; done

cdir() {
  cd $(dirname "$1")
}