Last active
August 9, 2023 14:03
-
-
Save matrixik/18111002a33ad06a90c5cadceb5bbe77 to your computer and use it in GitHub Desktop.
Short starter for bash scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Uncomment for debugging | |
# set -o xtrace | |
set -eo pipefail # Exit the script if any statement returns error. | |
log() { echo -e "$(date --iso-8601=seconds)" "$1"; } | |
error() { log "ERROR: $1"; } | |
warn() { log "WARNING: $1"; } | |
inf() { log "INFO: $1"; } | |
SCRIPT_DIR="$( dirname "$(readlink -f "$0")" )" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment