Skip to content

Instantly share code, notes, and snippets.

@kodopik

kodopik/header.bash

Created Sep 22, 2018
Embed
What would you like to do?
#!/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