Skip to content

Instantly share code, notes, and snippets.

@cameroncondry
cameroncondry / example.sh
Created February 18, 2018 23:39 — forked from shakefu/example.sh
Bash Script with Short and Long Options
# Option defaults
OPT="value"
# getopts string
# This string needs to be updated with the single character options (e.g. -f)
opts="fvo:"
# Gets the command name without path
cmd(){ echo `basename $0`; }