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