The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Users in AIX Lost in AIX AIX 3 06-04-2007 01:44 PM
Users In AIX Lost in AIX UNIX for Dummies Questions & Answers 1 05-24-2007 03:12 PM
Users on AIX 5.2 aldowsary AIX 4 11-06-2006 10:30 PM
Users catwomen HP-UX 1 10-12-2006 08:11 PM
do i need these users? csaunders SUN Solaris 3 04-11-2006 01:45 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-03-2007
ladytwo ladytwo is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 3
look for users to be looged on or off

what am i doing wrong here's code. i have a file that has names of users and i want to know when they log on and off.

while true
do
for X in "friends1"
do
if who | grep "$X"
then
echo "$X is logged in"
else
sleep 5
fi

echo who > on
if [ $X -ne on]
then
echo "$X is logged off"
else
else sleep 5
fi
done
done
  #2 (permalink)  
Old 10-05-2007
blowtorch's Avatar
blowtorch blowtorch is offline Forum Advisor  
Supporter
  
 

Join Date: Dec 2004
Location: Singapore
Posts: 2,350
Perhaps you want to explain what exactly you want to do. There is quite a difference between what you are saying and doing.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:39 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0