Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
285 B
4
Indexable
Never
#!/bin/bash

if [[ -z "$3" ]]; then
	op=$ARITHMETIC_OP
else
	op=$3
fi


if [[ $op == "add" ]]; then
	echo $(($1 + $2))
elif [[ $op == "sub" ]]; then
	echo $(($1 - $2))
elif [[ $op == "mul" ]]; then
	echo $(($1 * $2))
elif [[ $op == 'div' ]]; then
	echo $(($1 / $2))
fi