Re: whoami and bash

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

 



On Wed, Jul 11, 2007 at 02:37:37PM +0200, Francois wrote:
> > Why do you not use the "id -u" command and check for 0 as result?
> 
> Yes, I could do that. thanks. Francois

If you're checking for root user, you can use also $UID.
if [ $UID -eq 0 ]; then
	echo "I am root"
else
	echo "I am a lowly user with id $UID"
fi

-- 
lfr
0/0

Attachment: pgpZMzNIobKo8.pgp
Description: PGP signature


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux