From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 9 17:03:47 2010 Return-Path: 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 168171065673 for ; Sat, 9 Oct 2010 17:03:47 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 052768FC1C for ; Sat, 9 Oct 2010 17:03:45 +0000 (UTC) Received: by iwn8 with SMTP id 8so2576834iwn.13 for ; Sat, 09 Oct 2010 10:03:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=W76H0OErhdJGnVDXBvEF98TBZQX3cRopfhqk4zPWa70=; b=mV86AiTndkM1CxEW4hCe9hbrqODuPqQWRv9sGxI1EQM65p+8ezYO+cayHGMYBLca/T XrH78a7XXhggNXRAkeSy4m5/Rv7HaLwL1J1cpicroe/mekU3VE7Dohv3kxGhiyILUDxA hmw+2NGmlaUBKkNvG493v5EYJv2OhL2OzuZ7Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=D8cd4r2NR5WOxZI7sMYiAgHILg9L4cRRPaXw3C5EaBblwpl8AdGQIdTcEAR8Gmhl+Z zaVotUW23HE632jkGXdi9RanIkO5964OcyXA2OYcVb7NnFyx8eW8zCwrkpYKqD6jShJi +TdRb/MqZIIoyc5WjIUNj+KmrIlohw+3bzcnE= MIME-Version: 1.0 Received: by 10.42.211.131 with SMTP id go3mr755294icb.393.1286643824723; Sat, 09 Oct 2010 10:03:44 -0700 (PDT) Sender: yanegomi@gmail.com Received: by 10.231.184.3 with HTTP; Sat, 9 Oct 2010 10:03:44 -0700 (PDT) In-Reply-To: <4CAD7CA1.4050202@freebsd.org> References: <1286397912.27308.40.camel@localhost.localdomain> <51B4504F-5AA4-47C5-BF23-FA51DE5BC8C8@vicor.com> <4CAD513F.3010903@DataIX.net> <4CAD7563.1070706@DataIX.net> <4CAD7CA1.4050202@freebsd.org> Date: Sat, 9 Oct 2010 10:03:44 -0700 X-Google-Sender-Auth: 9KEHVzlvVHr7acvm4ayhCNDpyVk Message-ID: From: Garrett Cooper To: Julian Elischer Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Brandon Gooch , Devin Teske , freebsd-hackers@freebsd.org 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Oct 2010 17:03:47 -0000 On Thu, Oct 7, 2010 at 12:54 AM, Julian Elischer wrote= : > =A0On 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.. > =A0instead of the dozens of homegrown solutions people have written for p= uting > something > into /etc/rc.conf =A0one can use this. > > 2/ what is the value of X on machines a,b,c > =A0foreach machine in a b c > =A0do > =A0 =A0 =A0ssh $machine sysrc X > =A0done > > =A0 =A0you may well say "you could have used grep" bu tgrep doesn't give = the > default value vie the > =A0 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 > =A0"grep -v X /etc/rc.conf >/tmp/x;echo X >> /tmp/x; mv /tmp/x /etc/rc.co= nf" I was going to say... 3A On a system where you're logged in via singleuser, sometimes terminal settings don't work correctly with editors (these days it's mostly because /usr isn't available so it can't load ncurses apps, some libs, termcap, etc). That would be a lifesaver in this case. But then I realized that this command probably would live in /usr/sbin and would probably need other apps in /usr/bin // /usr/sbin to run this command :). Thanks! -Garrett