I tried to negate the following condition:
if pgrep "$NAME" >> /dev/null; then
# stuff
fi
At first I tried a syntax, what you can found in this thread.
if ! [[ pgrep "$NAME" >> /dev/null ]]; then
# stuff
fi
While this syntax is perfect if you want to compare variables and literals, however in my case it will fail with the following error:
watchdog: line 58: conditional binary operator expected
watchdog: line 58: syntax error near `"$NAME"'
watchdog: line 58: ` if ! [[ pgrep "$NAME" >> /dev/null ]]; then'