Hi there
I am still very new to scripting in Unix and hope you will help me a bit.
Here are a couple of examples of my troubles.
-------------------------------------------------
How do I check a username (or uid). I have tried man getuid, man uid etc.
and nothing comes up. Here is what I am trying to do:
if [ "${User}" != "root" ]; then
# Only su may run this script
echo " Im sorry, but you may not use this script"
exit 1
else
continue
fi
--------------------------------------------------
Here is another test problem.
until [ "${test}" = 1 ]
# testvar is made to authenticate correct keystroke
do
echo " ---------------------------------------"
echo " - Menusomething -"
echo " - Hit (U)ser, (G)roup or (D)isconnect -"
echo " ---------------------------------------"
read menu
if [ "${menu} = "u-U" ]; then
# should I use case instead? and what syntax makes u the same as U?
test=1
adduser;
# calls preveously defined function
elif [ "${menu} = "g-G" ]; then
test =1
addgr;
elif [ "${menu} = "d-D" ]; then
exit 0
else
echo "you mistyped"
echo
fi
done
echo "You made it through the Until sentence"
-----------------------------------------------------
I have several other questions to making my little program work. But I
quess it's better to ask a little at a time.
regards from
Leif
PS: Thanks for helping me earlier. Scripting is a lot easyer than making C
programs.
Being not very educated I learn easyer by example (stealing or recycling)
and links to already made scripts will be most welcome