Skip to content

Instantly share code, notes, and snippets.

View QWxleA's full-sized avatar

Alex QWxleA

View GitHub Profile
@QWxleA
QWxleA / sh_env_var_opts.sh
Created September 30, 2017 12:11 — forked from KylePDavis/sh_env_var_opts.sh
Simple bash shell script templates. There are two versions: 1) simple env var based options, and 2) with added command line argument parsing and error handling.
#!/bin/bash -e
# A SHORT DESCRIPTION OF YOUR SCRIPT GOES HERE
# USAGE:
# DESCRIPTION OF ENV VARS HERE
###############################################################################
set -e # exit on command errors (so you MUST handle exit codes properly!)
set -o pipefail # capture fail exit codes in piped commands
#set -x # execution tracing debug messages
# Get command info