Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # enter your function code here
- function ENGLISH_CALC {
- case $2 in
- "plus") echo "$1 + $3 = $(($1 + $3))";;
- "minus") echo "$1 - $3 = $(($1 - $3))";;
- "times") echo "$1 * $3 = $(($1 * $3))";;
- esac
- }
- # testing code
- ENGLISH_CALC 3 plus 5
- ENGLISH_CALC 5 minus 1
- ENGLISH_CALC 4 times 6
Add Comment
Please, Sign In to add comment