[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: posix-compliant (ash-compliant) test for root



David Coe <david@someotherplace.org> wrote:

> In a shell script that tests for root like this: 

>         if [ $UID != 0 ] ; then ...

> it fails if the shell is ash, because $UID is undefined.

What about 

     if [ "`id -u`" != 0 ]; then ...

id is in shellutils, which is a required package.

Tschoeeee

        Roland

-- 
 * roland@spinnaker.de * http://www.spinnaker.de/ *


Reply to: