I am trying to match on the presence of a word in a list before adding that word again (to avoid duplicates). I am using bash 4.2.24 and am trying the below:
This worked for me
bar='\' [[ $foo =~ $bar ]]