File: genstr

package info (click to toggle)
aee 2.2.15b-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 812 kB
  • ctags: 1,656
  • sloc: ansic: 17,475; sh: 504; makefile: 64
file content (32 lines) | stat: -rwxr-xr-x 489 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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