From owner-freebsd-questions@FreeBSD.ORG Fri Aug 4 03:14:18 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E1A3516A4DD for ; Fri, 4 Aug 2006 03:14:18 +0000 (UTC) (envelope-from on@cs.ait.ac.th) Received: from mail.cs.ait.ac.th (mail.cs.ait.ac.th [192.41.170.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3248243D45 for ; Fri, 4 Aug 2006 03:14:17 +0000 (GMT) (envelope-from on@cs.ait.ac.th) Received: from banyan.cs.ait.ac.th (banyan.cs.ait.ac.th [192.41.170.5]) by mail.cs.ait.ac.th (8.13.1/8.12.11) with ESMTP id k743EDd8023036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 4 Aug 2006 10:14:14 +0700 (ICT) Received: (from on@localhost) by banyan.cs.ait.ac.th (8.13.3/8.12.11) id k743EBK6050609; Fri, 4 Aug 2006 10:14:11 +0700 (ICT) Date: Fri, 4 Aug 2006 10:14:11 +0700 (ICT) Message-Id: <200608040314.k743EBK6050609@banyan.cs.ait.ac.th> From: Olivier Nicole To: freebsd@hub.org In-reply-to: <20060803180553.B6529@ganymede.hub.org> (message from User Freebsd on Thu, 3 Aug 2006 18:30:08 -0300 (ADT)) References: <20060803180553.B6529@ganymede.hub.org> X-Virus-Scanned: on CSIM by amavisd-milter (http://www.amavis.org/) Cc: freebsd-questions@freebsd.org Subject: Re: Stand up and be counted - BSDStats Project X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Aug 2006 03:14:19 -0000 > pciconf -lv needs to be parsed, this being the hard step, into a string > that can be sent via HTTP ... this is the hard part because it has to be > done as/in a shell script ... anyone out there *really* good at shell > programming? Why not doing the parsing on the server? Is there a limit on the size of an HTTP GET request? If not, the output of pciconf -v can fit in one single request, done. And limiting the number of requests, you also limit the amount of data xfered. I'd also go for: pciconf -l | sed s/\ /+/g | sed s/\ /%09/g| sed s/@/%40/g | sed s/:/%3a/g| sed s/=/%3d/g and you get lines like: hostb0%40pci0%3a0%3a0%3a%09class%3d0x060000+card%3d0x341a8086+chip%3d0x254c8086+rev%3d0x01+hdr%3d0x00 none0%40pci0%3a0%3a1%3a%09class%3d0xff0000+card%3d0x341a8086+chip%3d0x25418086+rev%3d0x01+hdr%3d0x00 That are almost completely URL encoded. Remains to replace the newline into %0d, and you are done. Result is one line that is around 2000 characters. olivier