From owner-freebsd-current@FreeBSD.ORG Mon May 3 11:59:24 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 72AED16A4CE for ; Mon, 3 May 2004 11:59:24 -0700 (PDT) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4385043D41 for ; Mon, 3 May 2004 11:59:24 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 6254 invoked from network); 3 May 2004 18:59:22 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 3 May 2004 18:59:22 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i43IxIT8057272; Mon, 3 May 2004 14:59:19 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: freebsd-current@FreeBSD.org Date: Mon, 3 May 2004 14:59:36 -0400 User-Agent: KMail/1.6 References: <20040501122238.63D2A43D41@mx1.FreeBSD.org> In-Reply-To: <20040501122238.63D2A43D41@mx1.FreeBSD.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200405031459.36127.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx Subject: Re: kenv enhancement X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 May 2004 18:59:24 -0000 On Saturday 01 May 2004 08:22 am, Danny Braniss wrote: > Hi, > I propose to bring back some lost options to kenv, -c and -s > ie, > kenv -c class [-s] > so that > kenv -h is equivalent to kenv -c hint. > and > kenv -c boot.nfsroot. -s > gives: > nfshandle="X9ca48b3f5b77454e0c00000002000000bfa3063100000000000000000000000 >0X" path="/d/6" > server="132.65.16.100" > > the 'enhanced' kenv is in > ftp://ftp.cs.huji.ac.il/users/danny/freebsd/kenv/ > > danny I rototilled this a bit to make it use the existing style. I also renamed 'class' to prefix since you can do things like 'kenv -p kern -s' to get interesting output like: el="kernel" el_options="" elname="/boot/kernel/kernel" :-P One thing to note is that 'kenv -p foo' is basically the same as 'kenv | grep ^foo', and that 'kenv -p foo -s' is basically the same as 'kenv | sed -ne '/^foo/{s///;p;}'. Generally new options aren't added to programs if they can be easily duplicated via a simple pipeline. Is there a reason that you need kenv to do this explicitly rather than using sed or grep? -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org