From owner-freebsd-stable Tue Oct 3 1:41:58 2000 Delivered-To: freebsd-stable@freebsd.org Received: from leeann.snedmail.com (lgoldste.dsl.speakeasy.net [64.81.34.20]) by hub.freebsd.org (Postfix) with ESMTP id 905CD37B503 for ; Tue, 3 Oct 2000 01:41:55 -0700 (PDT) Received: from leeann.snedmail.com (lgoldste@localhost) by leeann.snedmail.com (8.9.3/8.9.3) with ESMTP id BAA17038; Tue, 3 Oct 2000 01:41:52 -0700 (PDT) (envelope-from lgoldste@leeann.snedmail.com) Message-Id: <200010030841.BAA17038@leeann.snedmail.com> To: Stijn Hoop Cc: Lee Ann Goldstein , stable@freebsd.org, lgoldste@leeann.snedmail.com Subject: Re: A new file for the base system? In-reply-to: Your message of Tue, 03 Oct 2000 10:13:24 +0200. <20001003101324.A92210@pcwin002.win.tue.nl> Date: Tue, 03 Oct 2000 01:41:52 -0700 From: Lee Ann Goldstein Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --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 > > 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: 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:", "", "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