From owner-freebsd-hackers@FreeBSD.ORG  Thu Oct  7 08:15:03 2010
Return-Path: <owner-freebsd-hackers@FreeBSD.ORG>
Delivered-To: freebsd-hackers@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 11D04106566B
	for <freebsd-hackers@freebsd.org>; Thu,  7 Oct 2010 08:15:03 +0000 (UTC)
	(envelope-from julian@freebsd.org)
Received: from out-0.mx.aerioconnect.net (outm.internet-mail-service.net
	[216.240.47.236])
	by mx1.freebsd.org (Postfix) with ESMTP id C35778FC13
	for <freebsd-hackers@freebsd.org>; Thu,  7 Oct 2010 08:15:02 +0000 (UTC)
Received: from idiom.com (postfix@mx0.idiom.com [216.240.32.160])
	by out-0.mx.aerioconnect.net (8.13.8/8.13.8) with ESMTP id
	o977rOEq001088; Thu, 7 Oct 2010 00:53:25 -0700
X-Client-Authorized: MaGic Cook1e
X-Client-Authorized: MaGic Cook1e
X-Client-Authorized: MaGic Cook1e
X-Client-Authorized: MaGic Cook1e
Received: from julian-mac.elischer.org
	(h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137])
	by idiom.com (Postfix) with ESMTP id D68122D6017;
	Thu,  7 Oct 2010 00:53:22 -0700 (PDT)
Message-ID: <4CAD7CA1.4050202@freebsd.org>
Date: Thu, 07 Oct 2010 00:54:09 -0700
From: Julian Elischer <julian@freebsd.org>
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US;
	rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4
MIME-Version: 1.0
To: jhell <jhell@DataIX.net>
References: <1286397912.27308.40.camel@localhost.localdomain>	<AANLkTikoohMo5ng-RM3tctTH__P6cqhQpm=FPhSE9mMg@mail.gmail.com>	<51B4504F-5AA4-47C5-BF23-FA51DE5BC8C8@vicor.com>	<4CAD513F.3010903@DataIX.net>	<D5D9B585-96DA-4BD0-899D-A7BFFC0C540C@vicor.com>
	<4CAD7563.1070706@DataIX.net>
In-Reply-To: <4CAD7563.1070706@DataIX.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.67 on 216.240.47.51
Cc: Brandon Gooch <jamesbrandongooch@gmail.com>, freebsd-hackers@freebsd.org,
	Devin Teske <dteske@vicor.com>
Subject: Re: sysrc -- a sysctl(8)-like utility for managing /etc/rc.conf et.
 al.
X-BeenThere: freebsd-hackers@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Technical Discussions relating to FreeBSD
	<freebsd-hackers.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-hackers>, 
	<mailto:freebsd-hackers-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-hackers>
List-Post: <mailto:freebsd-hackers@freebsd.org>
List-Help: <mailto:freebsd-hackers-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-hackers>,
	<mailto:freebsd-hackers-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 07 Oct 2010 08:15:03 -0000

  On 10/7/10 12:23 AM, jhell wrote:
>
> Alright thank you for your explanation. I do not normally see this usage
> and this just sort of stood out at me and I did not want to assume what
> you were trying to accomplish, without asking.

three useage cases come to mind immediately.

1/ use within other scripts..
  instead of the dozens of homegrown solutions people have written for 
puting something
into /etc/rc.conf  one can use this.

2/ what is the value of X on machines a,b,c
   foreach machine in a b c
   do
       ssh $machine sysrc X
   done

     you may well say "you could have used grep" bu tgrep doesn't give 
the default value vie the
    hierachy of .rc files.
2A is of course to correc teh values found to be wrong with (2)

3/ on a really small system, without an editor this may do a cleaner 
job than the usual
  "grep -v X /etc/rc.conf >/tmp/x;echo X >> /tmp/x; mv /tmp/x 
/etc/rc.conf"