add os detection in count.sh