#! /bin/sh if test $# -eq 0 then echo "Usage: count-files " exit fi touch /tmp/t$$ find $1 -type f -exec /usr/bin/echo "1\c" >> /tmp/t$$ \; wc -c < /tmp/t$$ rm /tmp/t$$