uniquelabel
837 Bytes
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/sh
step=label
# outfile=${1%.u.dbg}.tvd.dbg
outfile=$1
#tmpfile=${1%.u.dbg}.tmp.dbg
tmpfile=`basename $1 .u.dbg`.tmp.dbg
/bin/rm -f $tmpfile 2> /dev/null
for lab in `cat $1`
do
if [ $step = label ]
then
step=address
label=$lab
else if [ $step = address ]
then
step=i
address=$lab
else if [ $step = i ]
then
step=label
echo "$address $label I" >> $tmpfile
fi
fi
fi
done
/bin/rm -f $outfile 2> /dev/null
step=label
for lab in `cat $tmpfile | sort`
do
if [ $step = label ]
then
step=address
address=$lab
else if [ $step = address ]
then
step=i
label=$lab
else if [ $step = i ]
then
step=label
if [ $lastaddr != $address ]
then
echo "$label $address I" >> $outfile
fi
lastaddr=$address
fi
fi
fi
done
/bin/rm -f $tmpfile 2> /dev/null