Counting Enterprise users with a script

Discuss the Scalix Server software

Moderators: ScalixSupport, admin

btisdall
Scalix Star
Scalix Star
Posts: 373
Joined: Tue Nov 22, 2005 12:13 pm
Contact:

Counting Enterprise users with a script

Postby btisdall » Wed Apr 12, 2006 9:19 am

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

ScalixSupport
Scalix
Scalix
Posts: 5503
Joined: Thu Mar 25, 2004 8:15 pm

Postby ScalixSupport » Wed Apr 12, 2006 10:39 am

The line

Code: Select all

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

Cheers

Dave

btisdall
Scalix Star
Scalix Star
Posts: 373
Joined: Tue Nov 22, 2005 12:13 pm
Contact:

Postby btisdall » Wed Apr 12, 2006 3:49 pm

Indeed it does.

Cheers!


Return to “Scalix Server”



Who is online

Users browsing this forum: No registered users and 8 guests