From owner-freebsd-hackers@FreeBSD.ORG Wed May 21 05:01:19 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9ED40FE1 for ; Wed, 21 May 2014 05:01:19 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 8AE9F2879 for ; Wed, 21 May 2014 05:01:19 +0000 (UTC) Received: from u10-2-16-025.office.norse-data.com (unknown [50.204.88.51]) by elvis.mu.org (Postfix) with ESMTPSA id 739631A3C19; Tue, 20 May 2014 22:01:13 -0700 (PDT) Message-ID: <537C335C.3060105@mu.org> Date: Tue, 20 May 2014 22:02:20 -0700 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Chris H Subject: Re: [GSoC] Machine readable output from userland utilities References: <49E9736E-AD14-4647-8B15-30603D01360C@mail.bg> <91FE2526-F21C-42AB-BECB-058DBA975A9E@cederstrand.dk> <537C2993.1060206@mu.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org, Erik Cederstrand X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 May 2014 05:01:19 -0000 On 5/20/14, 9:58 PM, Chris H wrote: >> >> Basically the idea would be to write a simple tool that is able to >> extract using an xpath or json selector. >> >> Example (very rough code): >> >> ifconfig --output xml | selector --format xml --path /name --path >> /name/etheraddr | \ >> while read name ether ; do >> echo "Interface $name has hardware address $ether" ; >> done >> >> In all seriousness though, the real target is people writing higher >> level languages (than shell) on top of FreeBSD. Perhaps python or ruby >> spawning a utility and then that utility making the output easy to read. >> >> One thing to note is that the output should not just be formatted but >> normalized as well. The fact that "uptime" can emit 15 different >> formats for the uptime string is terrible for people coding on top of >> the base utils, the json/xml/other output should be decided on some form >> of normalized data likely in seconds + microseconds or something, but >> anything truly machine readable is better than the current output when >> popen'd by a webapp. >> >> -Alfred > Greetings, all. > I may be getting into this thread a bit late in the game. But if I > understand the gist of this correctly; isn't all this pretty much what > Perl was intended for? > > All the best. I can't tell if you're late or early since the connection is breaking up, but from what I can make out you're stuck in 1997. -Alfred