On Tue, Mar 23, 2010 at 6:42 PM, Andrew Thompson <thom...@freebsd.org> wrote: > On Wed, Mar 24, 2010 at 02:09:41PM +1300, Atom Smasher wrote: >> On Tue, 23 Mar 2010, Garrett Cooper wrote: >> >>> Are you looking for data represented similar to sysctl(8)? >> ============ >> >> it doesn't quite have to be, but it is being parsed in a script. > > How about pulling the kenv variables into the script. > > #!/bin/sh > > eval $(kenv | awk -F= '/^smbios/ { gsub("\\\.","_",$1); print $1 "=" $2}') > > echo $smbios_chassis_maker
That's assuming that the there are only two tokens separated by = though... Maybe something like the following? eval $(kenv | awk -F= '{ gsub("\\\.", "_", $1); x= ""; for (i=1; i <= NF; i++) { if (i > 1) { x = x "="; } x = x "" $i; } print $1 "=" $x }') Thanks, -Garrett _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"