File: rectype.awk

package info (click to toggle)
mysql-dfsg-5.0 5.0.32-7etch12
  • links: PTS
  • area: main
  • in suites: etch
  • size: 89,332 kB
  • ctags: 94,781
  • sloc: cpp: 436,297; ansic: 409,141; sh: 40,574; tcl: 30,484; perl: 27,872; yacc: 8,236; makefile: 5,532; java: 4,610; xml: 3,914; pascal: 3,462; sql: 2,673; awk: 1,338; asm: 1,061; sed: 772
file content (27 lines) | stat: -rw-r--r-- 581 bytes parent folder | download | duplicates (11)
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
# $Id: rectype.awk,v 11.3 2000/07/17 22:00:49 ubell Exp $
#
# Print out a range of the log
# Command line should set RECTYPE to the a comma separated list
# of the rectypes (or partial strings of rectypes) sought.
NR == 1 {
	ntypes = 0
	while ((ndx = index(RECTYPE, ",")) != 0) {
		types[ntypes] = substr(RECTYPE, 1, ndx - 1);
		RECTYPE = substr(RECTYPE, ndx + 1, length(RECTYPE) - ndx);
		ntypes++
	}
	types[ntypes] = RECTYPE;
}

/^\[/{
	printme = 0
	for (i = 0; i <= ntypes; i++)
		if (index($1, types[i]) != 0) {
			printme = 1
			break;
		}
}
{
	if (printme == 1)
		print $0
}