I did it on bash under Linux, now I realize the Open Source "find" implementation has some options that Solaris doesn't, like -maxdepth...
You can use this alternative always using bash:
Quote:
for i in `find ./ -type d`;
do
echo $i `ls -l $i|/usr/xpg4/bin/grep -E '^-'|wc -l`;
done|cut -b 3-
Now on a Solaris 10 box under /usr:
/ 0
/lost+found 0
/share 3
/share/javadoc 0
/share/javadoc/smartcard 11
/share/javadoc/smartcard/com 0
/share/javadoc/smartcard/com/sun 0
/share/javadoc/smartcard/com/sun/smartcard 0
/share/javadoc/smartcard/com/sun/smartcard/scf 17
/share/javadoc/smartcard/resources 1
/share/javadoc/imq 14
/share/javadoc/imq/com 0
/share/javadoc/imq/com/sun 0
/share/javadoc/imq/com/sun/messaging 25
/share/javadoc/imq/com/sun/messaging/jms 21
/share/javadoc/imq/com/sun/messaging/xml 5
/share/javadoc/imq/javax 0
/share/javadoc/imq/javax/jms 61
/share/javadoc/imq/javax/xml 0
/share/javadoc/imq/javax/xml/messaging 12
/share/javadoc/imq/javax/xml/soap 28
/share/javadoc/imq/resources 1
/share/lib 11
/share/lib/jdmk 2
/share/lib/mailx 2
/share/lib/pub 4
/share/lib/tabset 10
/share/lib/terminfo 0
/share/lib/terminfo/3 18
/share/lib/terminfo/A 82
/share/lib/terminfo/a 289
<output truncated>