I Have three array variables like var[1]=1 var[2]=1 var[3]=1 Now i want to check all these three array variables is equal to 1 or not using if command.
I tried something like
if [[ ${var[@] == 1 ]]; then
echo "Yes"
else
echo "No"
fi
The result of the above code should be Yes but i'm getting No as an answer.
Can anyone please help me on this?
}. Also, you can't check whole array like that.${var[@]}will be"1 1 1", which is not equal to"1".