Hey all;
The answers that I received from this form is so usefull.Thanks for everyone.Now I have another one.
I have been working on my script to do the followings.The script tries to find who the user is :admin or regular user.
1.If the user is admin do the following

bunch of options).But admin;
a.he/she shouldn't use any argument when they run the script
b.They should also run "admin" script with "./admin" only
2.if the user is a regular user do the following(bunch of options)
a.They shouldn't use any argument
b.doesn't matter they run with "./admin " or " admin "
I tried the following but it didn't work.
Any better idea?
or correction of the existing one would be great
Belinda
user=`whoami`
echo "Greetings Users!"
#You are root running with no argument
if [[$user="root"] && [ $# -eq 0 ]]
then
if [[ $0 != "./admin" ]]
then
echo "Make sure you run with '\.\/admin' "
echo
sleep 3
else
until [[ $MENUCHOICE == "e" ]]
do
clear
echo "**************ADMIN MENU*******************"
echo
echo "a) User Manager"
echo "b) Group Manager"
"admin" 123L, 2362C
case $MENUCHOICE in
"a")
./usergrp.bash
;;
"b")
./grpmgr.bash
#You are root running with argument
else
if [[ $user = "root"] && [$# != 0 ]]
then
echo "Do not use any argument" $user
echo
sleep 3
exit
fi
fi
#You are reguler user
if [[$user != "root"] && [$# eq 0]]
then
until [[ $MENUCHOICE == "e" ]]
do
echo "**************REGULAR USER*****************"
echo
echo "a)Find your partner"
echo "b)Display team names"
#you are reguler user running with argument
else
if [ $user != "root" -a $# -gt 0 ]
then
echo " Do not use any argument" $user
sleep 3
exit
fi
fi
16,25 Top