Skip to content

Instantly share code, notes, and snippets.

@kodopik
Created September 22, 2018 19:29
Show Gist options
  • Save kodopik/dcf562c05c70ed5c3b7935cd1af6e39d to your computer and use it in GitHub Desktop.
Save kodopik/dcf562c05c70ed5c3b7935cd1af6e39d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# https://habr.com/post/413117/
if test "$BASH" = "" || "$BASH" -uc "a=();true \"\${a[@]}\"" 2>/dev/null; then
# Bash 4.4, Zsh
set -euo pipefail
else
# Bash 4.3 and older chokes on empty arrays with set -u.
set -eo pipefail
fi
shopt -s nullglob globstar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment