From c6980a21bfba168e4735cf45e6596101fd878518 Mon Sep 17 00:00:00 2001 From: Jack-Benny Persson Date: Thu, 12 Dec 2013 15:17:56 +0100 Subject: [PATCH] Kommenterat mer och lagt in exit 0 --- Labb4/ovning2.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Labb4/ovning2.sh b/Labb4/ovning2.sh index c528673..15a4c5f 100755 --- a/Labb4/ovning2.sh +++ b/Labb4/ovning2.sh @@ -11,6 +11,7 @@ Rate="6.3" printf "Do you want to convert from SEK or USD? " read Exchange +# Check our input if [ "$Exchange" != "USD" ] && [ $Exchange != "SEK" ]; then echo "Enter USD or SEK" exit 2 @@ -19,6 +20,7 @@ fi printf "Enter amount: " read Amount +# Case-statement in case we want other current in the future case "$Exchange" in USD) Answer=`echo "scale=2;$Amount*$Rate" | bc` @@ -30,3 +32,5 @@ case "$Exchange" in printf "$Amount SEK is $Answer USD\n" ;; esac + +exit 0