I am trying to check:
if $file is a binary, and the $file is not an image file then do something.
if [[ "$(file --dereference --mime "$FILE")" =~ binary ]] && [[ "$FILE" != \.jpg$|\.jpeg$|\.png$ ]]; then
echo "$1 is a binary file"
exit 0
fi
The error is a syntax error in conditional expression: unexpected token
I guess I am probably overlooking something simple. I have googled quite a bit but cannot get a working statement. Any tips are greatly appreciated.