Is there a way of checking all the elements in an array, and if all the elements in the array are not holding a string mystring to return true? For example, if any element of an array with 2 elements is holding mystring I want it to make it return as false, anything else is true:
[mystring][mystring] = false/don't do anything
[mystring][A] = false/don't do anything
[@#$2][mystring]=false/don't do anything
[asda][wrwe]=true
Q: How can check an array with n elements, if none of the elements within that array hold any other value other then mystring it should return true?
My attempt was:
for element_number in `seq 0 $going_through_the_elements_of_the_array`;
do
my_var=${the_array[$element_number]}
if ! [[ $my_var == "$my_string" ]]
then
echo " This should be printed"
exit
fi
done