Files
dotfiles-vim/.vim/templates/sh
chawley@hq.overdrive.com (chawley-vm) 961b7864ad Changes to shell template
2021-02-02 15:46:06 -05:00

38 lines
844 B
Plaintext

:insert
#!/usr/bin/env bash
#===============================================================================
#
# FILE:
# USAGE:
# DESCRIPTION:
# OPTIONS:
# REQUIREMENTS:
# NOTES:
# AUTHOR: C Hawley
# CREATED:
# REVISION:
#
#===============================================================================
set -o nounset # Treat unset variables as an error
# Check for empty argument
if [ -z "${1:-}" ]; then
arg="undefined"
echo "Required Argument Missing"
#exit 1
else
arg=$1
fi
# Log Echo: send output to screen and specified file
# Usage: logecho "Log Message"
# define logfile and path to enable logging to file
logfile=
logecho() {
echo "${1}"
if [[ ! -z "${logfile}" ]]; then
echo "${1}" >> "${logfile}"
fi
}