PageRenderTime 18ms CodeModel.GetById 11ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/contrib/ee/genstr

https://bitbucket.org/freebsd/freebsd-head/
Shell | 32 lines | 24 code | 7 blank | 1 comment | 2 complexity | a7f2bb72f5826cf66e4d37cc5b010db6 MD5 | raw file
 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