How do I negate a test with regular expressions in a bash script? October 6, 2022 by Tarik You had it right, just put a space between the ! and the [[ like if ! [[