Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jan 2009 21:41:31 -0600
From:      Jeffrey Goldberg <jeffrey@goldmark.org>
To:        Dan Nelson <dnelson@allantgroup.com>
Cc:        "mail.list freebsd-questions" <freebsd-questions@freebsd.org>
Subject:   Re: bash versus sh test builtin
Message-ID:  <7813F00E-0F26-4127-B85F-444EA6B8B5A6@goldmark.org>
In-Reply-To: <20090112030717.GA57874@dan.emsphone.com>
References:  <7740275E-77AA-45C1-B95E-C1F62D2AAB29@goldmark.org> <20090112030717.GA57874@dan.emsphone.com>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Jan 11, 2009, at 9:07 PM, Dan Nelson wrote:

> UID=$(id -u)
> if [ $UID -ne 0 ] ; then
> echo not root
> fi
>
> UID is not a variable set by /bin/sh, which is why the test fails.

Ah.  Thank you.  I was, as you see, barking up the wrong tree.  Thank  
you for setting me strait on this.

Cheers,

-j




Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?7813F00E-0F26-4127-B85F-444EA6B8B5A6>