The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



Thread: sticky bit??
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 02-04-2002
peter.herlihy peter.herlihy is offline
Registered User
 

Join Date: Nov 2001
Location: New Zealand
Posts: 333
The checking for user bit is as per below:

SCRIPT_USER=wcs1234
WHOAMI=$(/usr/ucb/whoami)

if [ "$WHOAMI" != "$SCRIPT_USER" ];then
echo "$CallName: script must be run by $SCRIPT_USER"
exit 1
else
echo "You are $WHOAMI - OK to continue..."
fi

Not sure how to make this execute with another user though....but here's half to check the user.
__________________
Pete