Test for root.

Carl Parrish plug-discuss@lists.PLUG.phoenix.az.us
Thu, 06 Sep 2001 17:25:06 -0700


Is it because it's testing the "word" whoami instead of the output? if 
show how do I make it exe the output first?

Carl P.

Carl Parrish wrote:

> Okay I'm writting a script that tests for root status. like so
>
> |
>
> test `whoami` = 'root' || echo "You must be root to execute the 
> commands."
>
> it never seems to be able to pass the test. From the command line I 
> can run whoami and get back root but it never works in the script. Any 
> idea what I'm doing wrong?
> Carl P.
> |
>
> ________________________________________________
> See http://PLUG.phoenix.az.us/navigator-mail.shtml if your mail 
> doesn't post to the list quickly and you use Netscape to write mail.
>
> PLUG-discuss mailing list  -  PLUG-discuss@lists.PLUG.phoenix.az.us
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>