freebsd-skq/contrib/tcsh/nls/catgen
2017-03-25 13:32:28 +00:00

21 lines
322 B
Bash
Executable File

#!/bin/sh
# Wrapper for gencat
TMP=/tmp/catgen.$$
trap "rm -f $TMP" 0 1 2 3 15
sortit() {
awk '/^\$set/ {print $2, FILENAME}' "$@" | sort -n | cut -d ' ' -f 2
}
GENCAT="$1"
shift
OUT="$1"
shift
CHARSET="$1"
shift
cat "${CHARSET}" $(sortit "$@") > "$TMP"
echo "$(basename "$OUT" .cat)"
"${GENCAT}" "$OUT" "$TMP"
exit 0