See:
* https://en.wikipedia.org/wiki/Code_refactoring
* https://www.refactoring.com/
* https://www.joelonsoftware.com/2002/01/23/rub-a-dub-dub/
Some small optimisations may have slipped in as well.
line_maxlen=78
# Check command line
-if [ $# -ne 2 ]
-then
- echo "Usage: ${0##*/} INFILE OUTFILE"
- exit 2
-fi
infile="$1"
shift
outfile="$1"
shift
+if test "$#" -ne 0
+then
+ echo "Usage: $0 INFILE OUTFILE"
+ exit 2
+fi
# Convert CSV to DAT + wrap long lines + remove trailing whitespace
while IFS="${csv_delimiter}" read -r number rule source