bash -c R=docs/experiments/instruments/instrument/line-count/reference echo "TRANSFER STANDARD: cloc $(cloc --version), --force-lang=C" echo "PRIMARY STANDARD: the LINE definition in docs/experiments/instruments/UNITS.md" echo "REFERENCE: hand enumeration in reference/*.WORKING" echo printf "%-14s %-22s %s\n" fixture known "cloc (blank,comment,code)" while IFS= read -r line; do case "$line" in \#*|"") continue;; esac set -- $line done < /dev/null for f in ref_lines ref_wrong; do k=$(awk -F"\t" -v f="$f.el" "\$2==f && \$3!=\"total\" {printf \"%s \", \$4}" $R/KNOWN-ANSWERS.tsv) c=$(cloc --force-lang=C --quiet --csv $R/$f.el 2>/dev/null | tail -1 | cut -d, -f3-5) kk=$(echo $k | tr " " ",") printf "%-14s %-22s %s %s\n" "$f.el" "$kk" "$c" "$([ "$kk" = "$c" ] && echo AGREES || echo DIVERGES)" done echo echo "Both fixtures agree. cloc is a valid transfer standard for the LINE unit." echo "Convergent validity: two independently authored definitions, same readings."