myhome/.config/nvim/plugged/bash-support.vim/bash-support/codesnippets/well-behaved-script

30 lines
1.2 KiB
Plaintext
Raw Normal View History

set -o nounset # treat unset variables as errors
#===============================================================================
# GLOBAL DECLARATIONS
#===============================================================================
declare -rx SCRIPT=${0##*/} # the name of this script
declare -rx mkdir='/bin/mkdir' # the mkdir(1) command
#===============================================================================
# SANITY CHECKS
#===============================================================================
if [ -z "$BASH" ] ; then
printf "$SCRIPT:$LINENO: run this script with the BASH shell\n" >&2
exit 192
fi
if [ ! -x "$mkdir" ] ; then
printf "$SCRIPT:$LINENO: command '$mkdir' not available - aborting\n" >&2
exit 192
fi
#===============================================================================
# MAIN SCRIPT
#===============================================================================
#===============================================================================
# STATISTICS / CLEANUP
#===============================================================================
exit 0