I'm writing a script in ksh. I need to find all users who have more than N processes and echo them in the shell. N is read from ksh.
I know that I should use ps -elf, but how do I parse it, find users with >N processes, and create an array with them? I'm having a little trouble with arrays in ksh. Maybe a simple solution can help me instead of having to to create an array. One person recommended that I use
ps -elf | awk '{a[$3]++;}END{for(i in a)if (a[i]>N)print i, a[i];}' N=3
but it doesn't work correctly.
