Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If or statments

Status
Not open for further replies.

ginger32

Technical User
Feb 17, 2003
6
GB
Can any one help! I have written a script to test how many logins a user has to pur RS6000 box. This works fine if i needed only on user to have 3 logins but i need many users to have the use of 3 sessions. I need to use the or statment but i cant seem to get this to work!

here is my script!
#Checks logins to determine whether or not they have login in too many sessions
if [ ! "`logname`%" = "devel%" ]
then
if [ "`logname`%" = "dev3%" -o / {here is where i am have issues!}
"`logname`%" = "devel1%" ]
then
if [ `who |grep $LOGNAME |wc -l` -gt 3 ]
then
echo "You will be disconnected due to too many logins"
sleep 5
exit
fi
else
if [ `who |grep $LOGNAME |wc -l` -gt 1 ]
then
echo "You will be disconnected due to too many logins"

 
Hi,
"-o" is well for integer. For strings you must use "||" for logical OR instead.
Regards Boris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top