Cover V09, I04
Article
Listing 1
Listing 2
Listing 3
Listing 4
Listing 5
Listing 6
Figure 1

apr2000.tar


Listing 6: sus

#!/bin/sh
#################################################################
# "@(#)sus"        
# Shellprogram    : sus
# Description     : Set the TERM variable and su - to user 
# Function        : Use two argument application groupname and 
#                 : username
# Date            : 991009
# Author          : Mats Brymér WM-data
# Version         : 1.0
#################################################################


Fel(){
echo "Usage
sus groupid userid
"
}

#
# Set TERM
#

if ls /usr/local/bin/start* |fgrep $1
then
TERM=$1;export TERM
else
Fel
exit
fi

#
# su command
#

if fgrep $2 /etc/passwd
then 
su - $2
else
Fel
fi