Use shell matching instead of sed(1) to strip comments and blank lines.

Since it doesn't depend on anything in /usr, it should work with a NFS-mounted
/usr partition.

Thanks to Bruce Evans to bringing this to my attention.
This commit is contained in:
Chris Costello 2000-08-09 02:03:30 +00:00
parent 3c2498c0d3
commit 9d182321ce
2 changed files with 20 additions and 16 deletions

View File

@ -3,14 +3,16 @@
# Read in /etc/sysctl.conf and set things accordingly
#
# $FreeBSD$
if [ -f /etc/sysctl.conf ]; then
sed '
/^[ ]*#/d
/^[ ]*$/d
s/#.*$//g
' /etc/sysctl.conf |
while read var
while read var comments
do
sysctl -w ${var}
done
case ${var} in
\#*|'')
;;
*)
sysctl -w ${var}
;;
esac
done < /etc/sysctl.conf
fi

View File

@ -3,14 +3,16 @@
# Read in /etc/sysctl.conf and set things accordingly
#
# $FreeBSD$
if [ -f /etc/sysctl.conf ]; then
sed '
/^[ ]*#/d
/^[ ]*$/d
s/#.*$//g
' /etc/sysctl.conf |
while read var
while read var comments
do
sysctl -w ${var}
done
case ${var} in
\#*|'')
;;
*)
sysctl -w ${var}
;;
esac
done < /etc/sysctl.conf
fi