Template for argument handling
while [[ $# -gt 0 ]]; do
key="$1"
case "${key}" in
-h|--help)
echo -e "\t-f | --first <first name>"
echo -e "\t-l | --last <last name>"
;;
-f|--first)
shift
first="$1"
;;
-l|--last)
shift
last="$1"
;;
esac
shift
done
# Interactively ask for unset but required variables
if [ -z ${first+x} ]; then
echo -n "First name: "
read first
fi
if [ -z ${last+x} ]; then
echo -n "Last name: "
read last
fi
Check for root user
if [[ $EUID -eq 0 ]]; then
echo "is root"
fi