From owner-freebsd-arch@FreeBSD.ORG Thu Jan 20 10:59:35 2011 Return-Path: Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 910D91065673; Thu, 20 Jan 2011 10:59:35 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 12DB48FC1B; Thu, 20 Jan 2011 10:59:34 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id p0KAxHUM053964; Thu, 20 Jan 2011 11:59:33 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id p0KAxHgn053963; Thu, 20 Jan 2011 11:59:17 +0100 (CET) (envelope-from olli) Date: Thu, 20 Jan 2011 11:59:17 +0100 (CET) Message-Id: <201101201059.p0KAxHgn053963@lurza.secnetix.de> From: Oliver Fromme To: freebsd-arch@FreeBSD.ORG, mdf@FreeBSD.ORG In-Reply-To: X-Newsgroups: list.freebsd-arch User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.5 (lurza.secnetix.de [127.0.0.1]); Thu, 20 Jan 2011 11:59:33 +0100 (CET) Cc: Subject: Re: Weed-whacking sysctl(8) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Jan 2011 10:59:35 -0000 mdf@freebsd.org wrote: > As bde@ mentioned, there's very little actual use of the sysctl format > strings. I recently changed it so the use is even smaller, but I've > got a quandary as to how to finish the job. > > I agree with Bruce that the formatted structs can just be removed. Will that break scripts that use sysctl(8) for monitoring, logging and similar tasks (vm.loadavg for example)? I've installed such scripts at a few customers' sites over the past years. It would be somewhat unfortunate if they break when the admins at those sites decide to update the OS. Don't get me wrong, I'm not trying to convince you to keep the formatted output for script compatibility. I understand the reasons why they should be removed. I'm just trying to evaluate the consequences. Best regards Oliver PS: Personally I like the format very much, because it's easy to use in shell scripts. For example, when you write set $(sysctl -n vm.loadavg) then you have the three values in $2, $3 and $4. Another phrase I've used in scripts quite often is this: X=$(sysctl -n kern.boottime) echo ${X#*\}} There are other ways to get that piece of information, but they're more complicated and/or less efficient. -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "Unix gives you just enough rope to hang yourself -- and then a couple of more feet, just to be sure." -- Eric Allman