Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- clear
- echo "First number is" $1
- echo "Second number is" $2
- var1=`echo $1`
- var2=`echo $2`
- while [[ $num -ne 1 ]]
- do
- if [[ var1 -ge 0 ]] && [[ var2 -ge 0 ]];
- then
- echo "Both numbers are positive"
- break
- else
- echo -n "You have entered negative number(s), please enter positive numbers: "
- read var1 var2
- fi
- done
- echo -n "Please choose one of the following letters to choose an option: "
- read option
- #echo "a) Display the sum of the two numbers."
- #echo "b) Display the product of the two numbers."
- #echo "c) State whether the two individual numbers are ODD or EVEN."
- #echo "d) Display the higher of the two numbers."
- #echo "e) What number did you like?"
- #echo "f) Quit/Exit."
- case $option in
- a) echo "The sum of the two intergers is: $(( var1 + var2 ))" ;;
- b) echo "The product of the two intergers is: $(( var1 * var2 ))" ;;
- c) echo "The number" ;;
- *) echo "INVALID OPTION" ;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement