1#!/bin/sh 2## $NetBSD: sysctlfs.sh.sh,v 1.1 2001/12/11 15:35:53 bgrayson Exp $ 3## Fast hack at a sysctl filesystem. The path can be either in 4## dot-style (kern.mbuf.msize) or in slash-style (kern/mbuf/msize). 5## Hacked as an example by Brian Grayson (bgrayson@NetBSD.org) in Sep 1999. 6for path in $*; do 7 ## First, change any slashes into dots. 8 path=`echo $path | tr '/' '.'` 9 ## Now invoke sysctl, and post-process the output to make it 10 ## friendlier. In particular: 11 ## 1. Remove the leading prefix. 12 ## 2. Remove a now-leading ".", if any. 13 ## 3. If we are left with " = <val>", strip out the " = " also. 14 sysctl $path | sed -e "s/$path//;s/^\.//;s/^ = //" 15done 16