Skip to content

Instantly share code, notes, and snippets.

@kovalevcon
Last active December 29, 2018 04:51
Show Gist options
  • Save kovalevcon/b562310d1c55983453a4623289587401 to your computer and use it in GitHub Desktop.
Save kovalevcon/b562310d1c55983453a4623289587401 to your computer and use it in GitHub Desktop.
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment