function users_getfirstpoolaccount () {

if [ $# -ne 1 ]; then
    echo "$0: supply a VO as an argument"
    return 1
fi

# Get the first pool account for the VO

ret=`
    awk --posix -F: '
	$6 == "" && $5 == tolower(virtorg) {
	    print $2
	}
    ' virtorg=$1 ${USERS_CONF} | sort | head -1
`

if [ "$ret" ]; then
    echo $ret
    return 0
else
    echo "$FUNCNAME: could not find pool account for $1 in ${USERS_CONF}" 1>&2
    return 1
fi

}
