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
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=64446
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