I am trying to make an if statement that checks to see if a variable is not equal to multiple different values.
Here's my code:
for subID in {1..100}
if [ "${subID}" != 2 8 34 56 89 92 ]
echo "Yes"
else
echo "No"
fi
done
I get an error saying that there are too many arguments. Is there a way to code for this completely within the if statement, or should I just set the values I want to compare as a separate variable using a for loop?