[98706] in RedHat Linux List

home help back first fref pref prev next nref lref last post

Re: A script problem

daemon@ATHENA.MIT.EDU (Anthony Greene)
Tue Nov 10 07:21:37 1998

From: Anthony Greene <agreene@pobox.com>
Date: Tue, 10 Nov 1998 12:19:54 GMT
To: redhat-list@redhat.com
In-Reply-To: <19981109233441.A11301@sylvester.dsj.net>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com

On 11/10/98, 12:34:41 AM, "David S. Jackson" <dsj@dsj.net> wrote:
> Thus spake Anthony E. Greene (agreene@pobox.com):
> > Shoudn't this line read:
> >
> >     USER=3D'/usr/bin/id -un'

> I think this is usually already set in /etc/profile on a RH system,
> right?  Way I read it was $USERID was a non-standard variable to play
> around with for learning purposes, even though it's redundant if $USER=

> is already set.

I checked my RH5.1 system and found that $USER, $USERNAME, and=20
$LOGNAME are set automatically. I found the following script to be=20
fast and reliable:

#!/bin/sh
=20
if [ $USER =3D "jdoe" ]; then
        echo "jdoe is logged in."
elif [ $USER =3D "root" ]; then
        echo "The Head Honcho is logged in."
else
        echo "Some peon is logged in."
        exit 1
fi





-- 
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
		http://www.redhat.com http://archive.redhat.com
         To unsubscribe: mail redhat-list-request@redhat.com with 
                       "unsubscribe" as the Subject.


home help back first fref pref prev next nref lref last post