The awk thing is a holdover from the Cray days, which used to have problems (http://www.spikynorman.dsl.pipex.com/CrayWWWStuff/Cfaqp2.html#TOC7) launching new processes. We used to have macho competitions to see who could do the most with the fewest number of child processes, all of which culminated in my writing a vast, rambling, workload manager daemon in horrific combination of awk and Korn shell. Ouch.
no subject
Date: 2006-10-09 07:53 pm (UTC)bruno paulstevenson $ find . -type f -exec ls -l {} \; | awk '{print $5}' | cut -c1-1 | sort | uniq -c
23674 1
14912 2
10707 3
8644 4
7967 5
7423 6
3456 7
3040 8
6472 9
(don't know what 's so special about 9)
no subject
Date: 2006-10-10 07:45 pm (UTC)23810 eld004> find . -type f -printf "%s\n" | awk '{f[substr($1,0,1)]++;t++} > END{for(i=1;i<11;++i){printf("%d %5.2f\n",i%10,100*f[i%10]/t)}}' 1 45.67 2 27.94 3 9.99 4 4.06 5 3.07 6 2.37 7 2.17 8 2.12 9 2.19 0 0.43 23811 eld004>What do you reckon? Could this be the birth of a new meme?
no subject
Date: 2006-10-11 09:36 pm (UTC)no subject
Date: 2006-10-11 10:14 pm (UTC)no subject
Date: 2006-10-12 08:15 am (UTC)find . -type f | xargs ls -l | awk '{f[substr($5,0,1)]++;t++}END{for(i=1;i<11;++i){printf("%d %5.2f\n",i%10,100*f[i%10]/t)}}'
no subject
Date: 2006-10-12 08:23 am (UTC)no subject
Date: 2006-10-12 08:24 am (UTC)find . -type f ! -empty -exec stat -f %z {} \; | awk '{f[substr($1,0,1)]++;t++} END{for(i=1;i<11;++i){printf("%d %5.2f\n",i%10,100*f[i%10]/t)}}'