Counting Enterprise users with a script
Posted: 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.
any pointers gratefully appreciated.
Ben Tisdall
RedCircle IT Ltd
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