Page 1 of 1

Counting Enterprise users with a script

Posted: Wed Apr 12, 2006 9:19 am
by btisdall
Hi,

I need to create a shell script function to count the number of Enterprise users on a system and I'm not sure why this gives '0' as its output, since replacing 'let count=count+0' with 'echo true' outputs 'true' the correct number of times.

Code: Select all

function countfull () {
let count=0
omshowu -m all | while read user; do
        omshowu -n "$user" | if grep "User Class : Full" > /dev/null; then
        let count=count+1
        fi
done
echo $count
}


any pointers gratefully appreciated.

Ben Tisdall
RedCircle IT Ltd

Posted: Wed Apr 12, 2006 10:39 am
by ScalixSupport
The line

Code: Select all

omsearch -d USERLIST -t H -s -e ul-class=full | wc -l
should do what you need.

Cheers

Dave

Posted: Wed Apr 12, 2006 3:49 pm
by btisdall
Indeed it does.

Cheers!