I was reading all of the posts about if statements but not of them seem to solve my issue. I'm writing a shell script and I need to validate the user's input for an operation (addition, subtraction, division). My code is as follows:
valid_operator(){
if [[ "$operator" != "+" || "$operator" != "-" || "$operator" != "/"]]; then
echo "Sorry, $operator, ++ is not a valid operator. Please re-enter valid operator"
main
fi
}
]].maindo in your code?