NetBSD-Users archive

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

Re: Scripting for /bin/ksh



On Wed, 4 Aug 2021, Todd Gruhn wrote:

My new problem is testing user rank/id.

I want to see if the user is "root"

if (user != root), then print message and die.


if [ $(id -u) -ne 0 ]
then	>&2 echo "${0##*/}: you are not superuser"
	exit 1
fi

-RVP



Home | Main Index | Thread Index | Old Index