Trying to check whether or not a value entered by a user is an integer, as well as equal to 35 or 75. If the value entered is an integer and equal to 35 or 75, then I wish to inform the user of this. If the entered value is anything other than 35 or 75 (e.g. a string, null or different integer) then I aim to let the user know it's not valid and for them to try again.
read -p 'Please enter an integer that is either equal to 35 or equal to 75: ' value
if [ $value =~ ^[0-9]+$ ] && ([ $value -eq 35 ] || [ $value -eq 75 ]
echo "The input is acceptable"
exit 1
else
echo "The value is invalid. Try again."
fi
exit 0
The error I keep receiving is line 10: syntax error near unexpected token 'else'