On Wed, Oct 6, 2010 at 1:45 PM, Devin Teske <dte...@vicor.com> wrote: > Hello fellow freebsd-hackers, > > Long-time hacker, first-time poster. > > I'd like to share a shell script that I wrote for FreeBSD system > administration. > > The attached shell script works similar to sysctl(8), but rather than > querying or working on sysctl MIBs, it instead works on the /etc/rc.conf > (and /etc/rc.conf.local) files. > > Syntax shown below (available by running the script without arguments): > > Usage: sysconf [OPTIONS] name[=value] ... > OPTIONS: > -h --help Print this message to stderr and exit. > -d Print list of internal dependencies before exit. > -e Print query results as `var=value' (useful for producing > output to be fed back in). Ignored if -n is specified. > -n Show only variable values, not their names. > > ENVIRONMENT: > SYSCONF_SHOW_DEPS Dump list of dependencies. Must be zero or one > (default: `0') > RC_DEFAULTS Location of `/etc/defaults/rc.conf' file. > > Examples: > > r...@mymachine ~ $ sysconf hostname > hostname: mymachine.localdomain > r...@mymachine ~ $ sysconf hostname=foomaster.deluxe.com > hostname: mymachine.localdomain -> foomaster.deluex.com > r...@mymachine ~ $ sysconf -e hostname > hostname="foomaster.deluxe.com" > r...@mymachine ~ $ sysconf -n hostname > foomaster.deluxe.com > > The script has zero external dependencies. None. Period. It will use > grep(1) if installed, but it is not required. > > Tested extensively on FreeBSD-4.8, FreeBSD-4.11, FreeBSD-8.0, and > FreeBSD-8.1.
I haven't looked at this yet, but this will result in user confusion as it differs in purpose from sysconf(3) (which is a POSIX API that helps determine system configuration tunable variables)... 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"