Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Oct 2000 01:41:52 -0700
From:      Lee Ann Goldstein <lgoldste@leeann.snedmail.com>
To:        Stijn Hoop <stijn@win.tue.nl>
Cc:        Lee Ann Goldstein <lgoldste@leeann.snedmail.com>, stable@freebsd.org, lgoldste@leeann.snedmail.com
Subject:   Re: A new file for the base system? 
Message-ID:  <200010030841.BAA17038@leeann.snedmail.com>
In-Reply-To: Your message of Tue, 03 Oct 2000 10:13:24 %2B0200. <20001003101324.A92210@pcwin002.win.tue.nl> 

next in thread | previous in thread | raw e-mail | index | archive | help

--Your message was: (from Stijn Hoop)
> On Tue, Oct 03, 2000 at 01:02:09AM -0700, Lee Ann Goldstein wrote:
> >
> > Hrrm. I get:
> > 
> > lgoldste@leeann 479% cat irqpci.txt | ./find_irq.awk | sort -n +2 -3
> > atkbd0  irq  1
> > pcm0    irq  5
> > fdc0    irq  6
> > pci1    irq  9 pci1.0.0 <ATI Mach64-GB graphics accelerator>
> > uhci0   irq 11 pci0.7.2
> > xl0     irq 11 pci0.7.0
> > psm0    irq 12
> > ata0    irq 14
> > ata1    irq 15
> 
> Strange....
> 
> > Might be a typo somewhere (which is why I cc:ed this to the list),
> > so here's the awk script again:
> > 
> > (because of the tabs, linewraps, etc., I recommend saving this whole
> > message to a file and then editing all but the awk script away :)
> 
> [find_irq.awk snipped]
> 
> That was what I did before. I tried the same with this version, with the same
> results as before...
> 
> awk --version gives me
> 
> GNU Awk 3.0.4
> Copyright (C) 1989, 1991-1999 Free Software Foundation.
> 
> Maybe this is different from yours?

Nope, same version:

lgoldste@leeann 485% awk --version
GNU Awk 3.0.4
Copyright (C) 1989, 1991-1999 Free Software Foundation.

The line

pci1: <ATI Mach64-GB graphics accelerator> at 0.0 irq 9

will be processed by the clause

/^pci[0-9]+/ {irqinfo = gensub(/(^[a-z0-9]+[: ]).*(<[[:print:]]+>).*([0-9]+\.[0-9]+) (irq [0-9]+$)/,"\\1	\\4 \\1.\\3 \\2", 1)
	 gsub(/:/, "", irqinfo)
	 sub(/ [0-9] /, " &", irqinfo)
	 print irqinfo
	 next
	}

So the problem, whatever it is, is somewhere within the regex used in the
gensub call. All on one line, that regex looks like this (I've marked the
3 blanks in the pattern):

/(^[a-z0-9]+[: ]).*(<[[:print:]]+>).*([0-9]+\.[0-9]+) (irq [0-9]+$)/
              ^                                      ^    ^
This should pick out, as individual tokens, "pci1:",
"<ATI Mach64-GB graphics accelerator>", "0.0", and "irq 9". But the way
this is written, if any of those blanks were really a tab, the pattern
wouldn't match, and you'd get the output you're seeing. Try replacing
the 2nd blank with [[:blank:]], which will also match a tab, and let me
know if that works.

Lee Ann

--
Lee Ann Goldstein
		Caffeine is *not* a substitute for sleep.
lgoldste@leeann.snedmail.com	lgoldste@lafn.org	leeann@rand.org


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200010030841.BAA17038>