Is there a way of checking if a string exists in an array of strings - without iterating through the array?
For example, given the script below, how I can correctly impl
array=('hello' 'world' 'my' 'name' 'is' 'perseus') regex="^($(IFS=\|; echo "${array[*]}"))$" test='henry' [[ $test =~ $regex ]] && echo "found" || echo "not found"