this shell script might work...
Code:
#!/bin/bash
id=1000
numuser=0;
while :
do
check=`cat /etc/passwd | grep $id`
if [[ -z "$check" ]]
then
echo -n "there are "
echo -n $numuser
echo " users"
break
else
((id++))
((numuser++))
fi
done
i just wrote this and it has only been tested on my system so it might not work....
also you might try
Code:
grep -c "" count `awk -F: '$6 ~ /\/home/ && $3 >= 500 {print $1}' /etc/passwd > count`
but that will leave a count file behind