1 # Ben Myers <0003571400@mcimail.com>
3 # Sum up number, line count, and sizes of SOURCE files in current directory
5 # bmawk -fsrcsize.awk workfile
6 # or similar command syntax with your awk program
7 # where workfile is a work file
9 # redirection done by shelled command
10 # system("dir *.* >workfile")
11 system("dir *.* >" ARGV[1])
12 ssize = 0 # size accumulator
13 slines = 0 # line counter
14 scount = 0 # obj counter
16 # Now read workfile back in
17 $2 == "C" || $2 == "H" || $2 == "CPP" || $2 == "HPP" {
18 filename = sprintf("%s.%s", $1, $2)
20 while (getline < filename > 0) {slines++}
24 print scount " files, " slines " lines, total size " ssize " bytes"
25 system("del " ARGV[1])