#! /bin/bash # Last edited on 2024-03-30 17:49:02 by stolfi # Usage: $0 # # Appends the files .bad.save and .good.save # to .js-check, with lines preceded respectively by "- " # and "+ ". Leaves the result on .js-check-new # if [[ $# -ne 1]]; then echo "** usage: fold-bad-good-save-into-js-check " 1>&2 exit 1 fi prefix="$1"; shift infile="${prefix}.js-check" outfile="${prefix}.js-check-new" tmpfile="${prefix}.js-check-tmp" cat ${infile} > ${tmpfile} cat ${prefix}.good.save | sed -e '1,$s/^/+ /g' >> ${tmpfile} cat ${prefix}.bad.save | sed -e '1,$s/^/- /g' >> ${tmpfile} sort -k2 -k1 ${tmpfile} | uniq > ${outfile} rm ${tmpfile} wc ${infile} ${outfile} 1>&2