In Bash, what is the simplest way to test if an array contains a certain value?
I typically just use:
inarray=$(echo ${haystack[@]} | grep -o "needle" | wc -w)
non zero value indicates a match was found.