![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need Script to Validate and Add more users one time | karthikn7974 | Shell Programming and Scripting | 3 | 02-10-2008 01:01 AM |
| shell script help for users | cmontr | Shell Programming and Scripting | 9 | 11-15-2007 10:17 AM |
| script to kill idle users | tayyabq8 | Shell Programming and Scripting | 8 | 04-24-2006 12:50 PM |
| Changing Users Passwords Via Script? | PJolliffe | UNIX for Advanced & Expert Users | 3 | 04-10-2002 09:54 AM |
| How do I change users in a script??? | chorgan | Shell Programming and Scripting | 2 | 02-15-2002 11:53 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Script: users
I need to make a script which does the following: - Display users logged on - Which sessions open - What they are doing atm. - To which group they belong - How long they are active or not This is what I got now: Code:
echo " "
echo Number of sessions:
ps v | grep "pts" | awk '{ print $2 }' | wc -l <------------ this is not ok yet
echo " "
echo "Most Frequent Process: "
ps -ef | awk '{ print $1 $8 }' | uniq -c | sort -r | nl | awk '{ print $1 " " $3 }' | grep "^1 " | awk '{ print $2}'
This works if there is one user online. But it will probably not work for more than one user... Guess I need a loop to do that... Would be nice if you could give me a hand . I'm not really good at this, and I'm sure that I can do most things a bit more simple :/. I'm a newbie too :P
Last edited by SignaTune; 06-10-2009 at 02:08 PM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|