xref: /freebsd/contrib/ee/genstr (revision 2e3f49888ec8851bafb22011533217487764fdb0)
1#!/bin/sh
2
3set -x
4
5if [ $# -lt 2 ]
6then
7	echo usage $0 source_file dest_file
8	exit 1
9fi
10
11trap 'rm -f /tmp/$$.out; exit 0' 0           # set up traps to clean up
12trap 'rm -f /tmp/$$.out; exit 1' 1 2 3 15    # on errors AND normal exit
13
14if [ -f $2 ]
15then
16	rm $2
17fi
18
19cat $1 | grep 'catgetlocal.*\"*\"' |
20	sed -e 's/^.*catgetlocal(//' |
21	sed -e 's/^[ 	]*//'	|
22	sed -e 's/, \"/ \"/'	|
23	sed -e 's/);//' > /tmp/$$.out
24
25cat > $2 <<EOF
26\$ 
27\$ 
28\$set 1
29\$quote "
30EOF
31
32sort -n < /tmp/$$.out >> $2
33