loc.sh¶
Counts the total lines of Pascal source code in the project.
Overview¶
loc.sh is a utility script that counts the total number of lines across all .pas files in the project. It is called by compile_vergen.sh to embed a line count into the kernel's version metadata.
Prerequisites¶
find,xargs,wc, andawkmust be available.
Inputs¶
All *.pas files found recursively from the current working directory.
Outputs¶
Prints a single line to stdout containing the total line count (e.g., 42567).
Behavior¶
- Uses
findto locate all.pasfiles starting from the current directory. - Pipes the file list to
xargs wc -lto count lines in each file. - Uses
awkto extract the grand total from the last line ofwcoutput.
Notes¶
- The output is consumed by
compile_vergen.shvia command substitution and piped throughawkto extract just the numeric value. - This script produces no files; it only writes to stdout.