Add and document support for handling comments and blank lines

in /etc/sysctl.conf.

Reviewed by:	imp, jkh
This commit is contained in:
chris 2000-01-16 18:12:42 +00:00
parent 60b021f075
commit f0051e751f
3 changed files with 21 additions and 7 deletions

View File

@ -4,10 +4,13 @@
#
# $FreeBSD$
if [ -f /etc/sysctl.conf ]; then
3< /etc/sysctl.conf
while read 0<&3 var;
sed '
/^[ ]*#/d
/^[ ]*$/d
s/#.*$//g
' /etc/sysctl.conf |
while read var
do
sysctl -w ${var}
done
3<&-
fi

View File

@ -4,10 +4,13 @@
#
# $FreeBSD$
if [ -f /etc/sysctl.conf ]; then
3< /etc/sysctl.conf
while read 0<&3 var;
sed '
/^[ ]*#/d
/^[ ]*$/d
s/#.*$//g
' /etc/sysctl.conf |
while read var
do
sysctl -w ${var}
done
3<&-
fi

View File

@ -42,6 +42,13 @@ command, i.e.
.Bd -literal -offset indent
sysctl_mib=value
.Ed
.Pp
Comments are denoted by a
.Dq #
at the beginning of a line. Comments can also exist at the end of a line,
as seen in the
.Sx EXAMPLES
section, below.
.Sh FILES
.Bl -tag -width /etc/sysctl.conf -compact
.It Pa /etc/sysctl.conf
@ -52,7 +59,8 @@ To turn off logging of programs that exit due to fatal signals, as well as
telling Linux programs that you are running FreeBSD 3.4-STABLE, you may use
a configuration like
.Bd -literal -offset indent
kern.logsigexit=0
# Configure logging and Linux execution.
kern.logsigexit=0 # Do not log fatal signal exits (e.g. sig 11)
compat.linux.osname=FreeBSD
compat.linux.osrelease=3.4-STABLE
.Ed