5 ms·
> [ $USER != "root" ] && echo You must be root && exit 1 I get that the authors point was more focused on the conditional usage, but this seems like a pretty b
by memco 6y ago
> [ $USER != "root" ] && echo You must be root && exit 1
I get that the authors point was more focused on the conditional usage, but this seems like a pretty bad way to check if the user is root and isn’t really any more complicated than checking EUID = 0 or some of the other methods.