Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- if [ $# -ne 3 ]; then
- echo "Usage: $0 <num1> <op> <num2>!"
- exit 1
- fi
- case $2 in
- +) res=$(($1+$3));;
- -) res=$(($1-$3));;
- \*) res=$(($1*$3));;
- /) res=$(($1/$3));;
- *)
- echo "invalid op"
- exit 1;;
- esac
- echo = $res
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement