kenv enhancement
John Baldwin
jhb at FreeBSD.org
Mon May 3 11:59:24 PDT 2004
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 <jhb at FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve" = http://www.FreeBSD.org
More information about the freebsd-current
mailing list