i have the following process running in background:
when i give "ps -lef"
------------------------------------------------------------------------
user2
user1
user1
user3
user1
user4
user5
user4
user3
user4
user2
user1
user1
user3
user1
user4
user5
user4
user3
user4
----------------------------------------------------------------------
i have the script
#!/bin/ksh
for i in user1 user2 user3 user4 user5
do
count=0
((count=`ps -lef | grep -c $i` - 1))
echo $i ech $count
done
-------------------------------------------------------------------
its giving o/p as
user1 6
user2 2
user3 4
user4 6
user5 2
---------------------------------------------------------------
i want to use only "user" in "for" loop as
-------------for i in user-----------------
and it should count the user for 1 to 5..
can u help me in this.....is there any way