xref: /freebsd/contrib/tcsh/nls/catgen (revision 6b2c1e49da284f28ec7b52f7c031474087e37104)
1#!/bin/sh
2# Wrapper for gencat
3TMP=/tmp/catgen.$$
4trap "rm -f $TMP" 0 1 2 3 15
5
6sortit() {
7	awk '/^\$set/ {print $2, FILENAME}' "$@" | sort -n | cut -d ' ' -f 2
8}
9
10GENCAT="$1"
11shift
12OUT="$1"
13shift
14CHARSET="$1"
15shift
16cat "${CHARSET}" `sortit "$@"` > "$TMP"
17
18echo "`basename "$OUT" .cat`"
19"${GENCAT}" "$OUT" "$TMP"
20exit 0
21