I would like a loop because I have a lot of exclusions. The issue is that I don't know how to use variables to do it.
Here is my code:
tabSearch=("20220514*" "20220508*" "20220515*")
find . \( ! -name "${tabSearch[0]}" -a ! -name "${tabSearch[1]}" \)
The idea is to use as -name $variable as a needed with a loop but I have a syntax issue. Can you help me please?
!,-a, etc in addition to the patterns. See "How to use Bash array of globs with find?"\( ! -name X -a ! -name X -a ! -name Z \)can be written as! \( -name X -o -name Y -o -name Z \)( for glob in "${tabSearch[@]}"; do tests+=(! -name "$glob"); done; find \( "${tests[@]}" \) )(-ais implied)