I'm writing a bash script where I want to exit if the user is not root. The conditional works fine, but the script does not exit.
[[ `id -u` == 0 ]] || (echo "Must be root to run script"; exit)
I've tried using
&& instead of
; but neither work.