[98513] in RedHat Linux List

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

Re: A script problem

daemon@ATHENA.MIT.EDU (Carey F. Cox)
Mon Nov 9 15:47:59 1998

Date: Mon, 9 Nov 1998 13:22:15 -0600 (EST)
From: "Carey F. Cox" <carey@tabasco.lamar.edu>
To: Red Hat Users List <redhat-list@redhat.com>
In-Reply-To: <Pine.LNX.4.05.9811091555420.8047-100000@winbuster.magic.fr>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com

On Mon, 9 Nov 1998, Zoki wrote:

> ********* The script *********************
> 
> #!/bin/sh
> 
> if  [ '/usr/bin/id -un' = "zokiphoto" ]; then
> 	### commands ###
> elif [ '/usr/bin/id -un' = "root" ]; then
> 	### commands ###
> else
> 	### exit message ###
> exit 1
> fi

Zoki, 

Try the following...

---------------------------------cut here------------------------------
#!/bin/sh

USRID=`/usr/bin/id -un`

if [ ${USRID} = "zokiphoto" ]; then
	### commands ###
elif [ ${USRID} = "root" ]; then
	### commands ###
else
	### exit message ###
	exit 1
fi
---------------------------------cut here------------------------------

 ======================================================================
<>   Carey F. Cox, PhD             |  PHONE: (409) 880-8770           <>
<>   Assistant Professor           |  FAX:   (409) 880-8121           <>
<>   Dept. of Mech. Eng.           |  EMAIL: carey@tabasco.lamar.edu  <>
<>   Lamar University              |  WEB:   N/A                      <>
 ======================================================================


-- 
  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