I want to remove the elements of an array which contains the elements of an other array.
EG
array1 = (aaaa bbbb abcd)
array2 = (b c)
result = (aaaa)
I've wrote this piece of code but it doesn't work
for element in "${array2[@]}"
do
result=(${array1[@]/.*$element.*})
done
could you tell me why and what should I do instead?