xref: /freebsd/contrib/tcsh/nls/catgen (revision 59c8e88e72633afbc47a4ace0d2170d00d51f7dc)
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