freebsd-dev/contrib/tcsh/nls/catgen
Brooks Davis cc698b4900 Update tcsh to 6.21.00.
This is a bugfix release with no new features.  A number of these fixes
were previously merged into our tree.

Sponsored by:	DARPA, AFRL
2019-10-08 20:59:31 +00:00

21 lines
320 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