Skip to content

Instantly share code, notes, and snippets.

Avatar

Jules Amonith examosa

View GitHub Profile
@examosa
examosa / script-template.sh
Last active November 15, 2021 16:18 — forked from m-radzikowski/script-template.sh
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
View script-template.sh
#!/usr/bin/env bash
set -Euo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd -P)
script_name=$(basename "${BASH_SOURCE[0]}")
usage() {