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