Advertisement
Guest User

loop

a guest
Oct 21st, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. stayin="y"
  2. while [ "$stayin" == "y" ]; do
  3. echo -n "input 1st operand: "
  4. read an1
  5. echo -n "input the operator: "
  6. read op1
  7. echo -n "input 2nd operand: "
  8. read an2
  9. echo -n "you input $an1 $op1 $an2 = "
  10. if [ "$op1" == "+" ]; then
  11. echo "addition"
  12. fi
  13. echo "continue (y/n): "
  14. read stayin
  15. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement