File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
- # $Id: ouiparse.awk,v 1.1 2000/08/23 06:02:23 thomas Exp $
1
+ # $Id: ouiparse.awk,v 1.2 2000/08/23 13:44:14 thomas Exp $
2
2
#
3
3
# ouiparse.awk
4
4
# Author: Lawrence E. Rosenman <ler@lerctr.org>
10
10
# manufacturer text);
11
11
# the table name is set by setting the AWK variable TABLE
12
12
#
13
- # we translate the character apostrophe (') to space inside the company name
14
- # to avoid SQL errors.
13
+ # we translate the character apostrophe (') to double apostrophe ('') inside
14
+ # the company name to avoid SQL errors.
15
15
#
16
- # match ONLY lines that begin with 2 hex numbers, -, and another hex number
17
16
18
17
BEGIN {
19
18
TABLE= " macoui" ;
27
26
printf " COMMIT TRANSACTION;" ;
28
27
}
29
28
29
+ # match ONLY lines that begin with 2 hex numbers, -, and another hex number
30
30
/^ [0 -9a -fA -F ][0 -9a -fA -F ]-[0 -9a -fA -F ] / {
31
31
# if (nrec >= 100) {
32
32
# printf "COMMIT TRANSACTION;";
47
47
Company= Company " " $i;
48
48
# Modify any apostrophes (') to avoid grief below.
49
49
gsub (" '" ," ''" ,Company);
50
- # Print out for the 'C' structure in mac.c
50
+ # Print out for the SQL table insert
51
51
printf " INSERT INTO %s (addr, name) VALUES (trunc(macaddr \'%s\'),\'%s\');\n " ,
52
52
TABLE,OUI,Company;
53
53
}
You can’t perform that action at this time.
0 commit comments