myhome/.config/nvim/plugged/bash-support.vim/bash-support/codesnippets/well-behaved-script
Marcin Woźniak fc7dc3f34a
Added bash-support
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
2020-11-16 12:54:24 +01:00

30 lines
1.2 KiB
Plaintext

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