commit 5e93e260d6e4b9282b6fa3b863cc0efa9adf96ea Author: David Thurstenson Date: Thu Jan 26 19:04:31 2017 -0600 initial commit diff --git a/bash/errmsg.sh b/bash/errmsg.sh new file mode 100644 index 0000000..1e3b962 --- /dev/null +++ b/bash/errmsg.sh @@ -0,0 +1,6 @@ +errmsg() { + # Usage: errmsg + # prints "Error in : " to stderr + printf "Error in %s: %s\n" "${FUNCNAME[1]}" "$1" >&2 +} + diff --git a/bash/function_source.sh b/bash/function_source.sh new file mode 100644 index 0000000..cd36b6b --- /dev/null +++ b/bash/function_source.sh @@ -0,0 +1,3 @@ +# If not running interactively, don't do anything +# Allows for using these functions as commands by sourcing this script +[[ $- != *i* ]] && return