: # # version 3.0 Sep 25 11:21:02 PDT 1998 umask 022 # This tool suite was written by and is copyrighted by Brad Powell, Matt # Archibald, and Dan Farmer 1992, 1993, 1994, 1995, 1996, 1997, 1998 with input # from Casper Dik, and Alec Muffett. # # The copyright holder disclaims all responsibility or liability with # respect to its usage or its effect upon hardware or computer # systems, and maintains copyright as set out in the "LICENSE" # document which accompanies distribution. # # Returns 0 if the user is root, 1 if not # PATH=/bin:/usr/bin:/sbin identity=`id | nawk -F\( '{ print substr($2, 1, index($2, ")") - 1) }'` if test $identity = "root" then echo 0 exit 0 fi # not root echo 1 exit 1