aboutsummaryrefslogtreecommitdiffstats
path: root/text_cmds/ee/genstr
diff options
context:
space:
mode:
Diffstat (limited to 'text_cmds/ee/genstr')
-rwxr-xr-xtext_cmds/ee/genstr32
1 files changed, 32 insertions, 0 deletions
diff --git a/text_cmds/ee/genstr b/text_cmds/ee/genstr
new file mode 100755
index 0000000..429f960
--- /dev/null
+++ b/text_cmds/ee/genstr
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+set -x
+
+if [ $# -lt 2 ]
+then
+ echo usage $0 source_file dest_file
+ exit 1
+fi
+
+trap 'rm -f /tmp/$$.out; exit 0' 0 # set up traps to clean up
+trap 'rm -f /tmp/$$.out; exit 1' 1 2 3 15 # on errors AND normal exit
+
+if [ -f $2 ]
+then
+ rm $2
+fi
+
+cat $1 | grep 'catgetlocal.*\"*\"' |
+ sed -e 's/^.*catgetlocal(//' |
+ sed -e 's/^[ ]*//' |
+ sed -e 's/, \"/ \"/' |
+ sed -e 's/);//' > /tmp/$$.out
+
+cat > $2 <<EOF
+\$
+\$
+\$set 1
+\$quote "
+EOF
+
+sort -n < /tmp/$$.out >> $2