Computing.Net > Forums > Unix > Korn shell script doubt ???

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Korn shell script doubt ???

Reply to Message Icon

Name: Balaji
Date: July 1, 2002 at 11:47:40 Pacific
Comment:

hi,
I have a question. I'm doing a Korn Shell script. I want to find out
the list of users who have either logged in or logged out during the period(like 20 minutes or etc).
Thank you for helping.(please give any hint)

bye bye
-balaji



Sponsored Link
Ads by Google

Response Number 1
Name: LANkrypt0
Date: July 1, 2002 at 13:10:17 Pacific
Reply:

hint:
man last

and/or

last | sort -k 1 | less


0

Response Number 2
Name: Balaji
Date: July 1, 2002 at 13:45:24 Pacific
Reply:

hi LANkrypt0,

Thanks for response . But could u plz use the last 20 minutes that who r logged in or logged out.
u didn't mention time. i searched man pages. but i didn't find any info regarding that.
could u plz use by time.
thanx,
balaji



0

Response Number 3
Name: frank
Date: July 2, 2002 at 01:34:11 Pacific
Reply:

Balaji,

refer to posting "Login Script"

SearchDate=`date +"%b %d"`
last |grep "$SearchDate"|awk '{system (" echo login: " $1 " at " $4,$5,$6 ) } '

or

Luser=`last | head -1`
Vuser=$Luser
while :
do
Luser=`last | head -1`
if [ "${Luser}" != "${Vuser}" ]
then
echo $Luser > /tmp/mytmp
mail a1xrdb1@cipofdc1 < /tmp/mytmp
Vuser=$Luser
fi
done


No RISK no fun


Frank


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Korn shell script doubt ???

sftp Korn shell script www.computing.net/answers/unix/sftp-korn-shell-script/4741.html

Korn Shell script for julian date? www.computing.net/answers/unix/korn-shell-script-for-julian-date/3729.html

Korn shell script www.computing.net/answers/unix/korn-shell-script/7285.html