Kommenterat mer och lagt in exit 0

This commit is contained in:
Jack-Benny Persson 2013-12-12 15:17:56 +01:00
parent b1f3b46a49
commit c6980a21bf

View File

@ -11,6 +11,7 @@ Rate="6.3"
printf "Do you want to convert from SEK or USD? " printf "Do you want to convert from SEK or USD? "
read Exchange read Exchange
# Check our input
if [ "$Exchange" != "USD" ] && [ $Exchange != "SEK" ]; then if [ "$Exchange" != "USD" ] && [ $Exchange != "SEK" ]; then
echo "Enter USD or SEK" echo "Enter USD or SEK"
exit 2 exit 2
@ -19,6 +20,7 @@ fi
printf "Enter amount: " printf "Enter amount: "
read Amount read Amount
# Case-statement in case we want other current in the future
case "$Exchange" in case "$Exchange" in
USD) USD)
Answer=`echo "scale=2;$Amount*$Rate" | bc` Answer=`echo "scale=2;$Amount*$Rate" | bc`
@ -30,3 +32,5 @@ case "$Exchange" in
printf "$Amount SEK is $Answer USD\n" printf "$Amount SEK is $Answer USD\n"
;; ;;
esac esac
exit 0