38 lines
844 B
Plaintext
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
|
|
}
|