You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Array expansions in [[ .. ]] will implicitly concatenate into a single string, much like in assignments. The problematic code is equivalent to [ "$ext" = "jpg bmp png" ].
Instead, use a for loop to iterate over values, and apply your condition to each.
Alternatively, if you do want to concatenate all the values in the array into a single string for your test, use "$*" or "${array[*]}" to make this explicit.