4 # make sure they gave us some arguments.
6 #hmmm: could use the count notation instead of sloppy empty check.
7 # reset first arg to be '*' to do any directories here.
8 #echo changing args to use all subdirs in current dir.
9 set -- $(find . -maxdepth 1 -mindepth 1 -type d) "${@:2}"
10 #echo "arg 1 is now '$1'"
13 # run through all the parameters provided and find any
14 # directories under them (or probably barf if they're not
17 # print the count of files followed by directory name,
18 # with leading zeros to allow sorting, which get
19 # redigested as spaces before showing the list.
20 printf "%06d -- %s\n" $(find "$i" -type f | wc -l) "$i"
22 # provide sorted output based on how many files exist
25 # eat the zeroes but keep the tabular look. this simple
26 # sed code will eat zeroes in names also. oops.