case $OPTION in
"$OPTION_1")
price_info
+ #break
;;
"$OPTION_2")
senior_rebate
+ #break
;;
*) ;;
esac
read ARTICLE
#article code length (includes '\n')
- let ARTICLE_LEN="$(echo "$ARTICLE" | wc -m )"
+ ARTICLE_LEN="$(echo "$ARTICLE" | wc -m )"
if [ ! $ARTICLE_LEN -eq "8" ]; then
echo "Invalid length of article code"
echo "Expected 7, got $ARTICLE_LEN" 1>&2
"64964")
PRICE=$(awk "BEGIN {print 120*${PRICE_MULTIPLIER}}")
echo -e "$ARTICLE (USB stick): $PRICE kronor\n"
+ #break
;;
"59457")
PRICE=$(awk "BEGIN {print 400*${PRICE_MULTIPLIER}}")
echo -e "$ARTICLE (headset): $PRICE kronor\n"
+ #break
;;
*)
echo -e "Hm, well I can't seem to find the product ($ARTICLE) in our system!\n"
+ #break
;;
esac
done
}
+ #TODO the age calculation is probably not exact!
function senior_rebate {
BIRTHDAY=""
fi
}
+
+ #tech_mode is entered by a Trap
+ #(as long as we are in a trap no additional traps can be made)
function tech_mode {
- #ignore SIGINT signals
- trap "" SIGINT
#Reset errors to tty
exec 2>/dev/tty
#Errors and warnings goes to both TTY and file
exec 2>file.log
#CTRL+C triggers admin mode (requires password)
- trap "tech_mode" SIGINT
+ trap tech_mode SIGINT
#0-1 arguments always shows help
if [ $# -lt 2 ]; then
case $1 in
"-shop")
user_mode $2
+ #break
;;
*)
help
+ #break
;;
esac
#Too many arguments show help