Skip to content

Instantly share code, notes, and snippets.

View elfsternberg's full-sized avatar
💭
Breathing

Ken "Elf" Mathieu Sternberg elfsternberg

💭
Breathing
View GitHub Profile
@elfsternberg
elfsternberg / bash_template.sh
Created April 6, 2022 15:36 — forked from andremueller/bash_template.sh
A bash template with argument parsing and error handling
#!/bin/bash
# my bash template
set -o errexit
set -o nounset
shopt -s nullglob
SCRIPT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
function die() {
echo "ERROR $? IN ${BASH_SOURCE[0]} AT LINE ${BASH_LINENO[0]}" 1>&2