From owner-freebsd-bugs@FreeBSD.ORG Wed Jan 11 07:40:10 2012 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B2D6106566B for ; Wed, 11 Jan 2012 07:40:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 63ECB8FC13 for ; Wed, 11 Jan 2012 07:40:10 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0B7eAWm074847 for ; Wed, 11 Jan 2012 07:40:10 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0B7eA5B074846; Wed, 11 Jan 2012 07:40:10 GMT (envelope-from gnats) Date: Wed, 11 Jan 2012 07:40:10 GMT Message-Id: <201201110740.q0B7eA5B074846@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Matthew Story Cc: Subject: Re: misc/164011: comments in rc.conf cause system loading X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthew Story List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 07:40:10 -0000 The following reply was made to PR misc/164011; it has been noted by GNATS. From: Matthew Story To: Eugen Konkov Cc: freebsd-gnats-submit@freebsd.org Subject: Re: misc/164011: comments in rc.conf cause system loading Date: Wed, 11 Jan 2012 02:10:26 -0500 --f46d043c07be761be204b63b53d8 Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jan 11, 2012 at 1:38 AM, Eugen Konkov wrote: > >How-To-Repeat: > If I put this line All is ok > ifconfig_vlan7="inet 10.11.19.149 netmask 255.255.255.248 vlan 7 vlandev > re0" # > When I do not keep space between " and # > ifconfig_vlan7="inet 10.11.19.149 netmask 255.255.255.248 vlan 7 vlandev > re0"# > rc.conf uses sh(1) syntax, per the man page: Options are set with ``name=value'' assignments that use sh(1) syntax. The following list provides a name and short description for each vari- able that can be set in the rc.conf file: (via man 5 rc.conf) per the POSIX specification, `#' only denotes a comment if it occurs at the beginning of a word: When it is not processing an *io_here*, the shell shall break its input into tokens by applying the first applicable rule below to the next character in its input. The token shall be from the current position in the input until a token is delimited according to one of the rules below; the characters forming the token are exactly those in the input, including any quoting characters. If it is indicated that a token is delimited, and no characters have been included in a token, processing shall continue until an actual token is delimited. [...snip] 10. If the current character is a '#', it and all subsequent characters up to, but excluding, the next shall be discarded as a comment. The that ends the line is not considered part of the comment. via: http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html In your given example: "inet 10.11.19.149 netmask 255.255.255.248 vlan 7 vlandev re0"# shell is still constructing a word (for assignemnt), which will result in the assignment of: inet 10.11.19.149 netmask 255.255.255.248 vlan 7 vlandev re0# to ifconfig_vlan. A relevant snippit from "The UNIX Programming Environment" below: The metacharacter # is almost universally used for shell comments; if a shell word begins with #, the rest of the line is ignored: $ echo hello # there hello $ echo hello#there hello#there $ (page 77) -- regards, matt --f46d043c07be761be204b63b53d8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
On Wed, Jan 11, 2012 at 1:38 AM, Eugen Konkov &= lt;kes-kes@yandex.ru> wr= ote:
>How-To-Repeat:
If I put this line All is ok
ifconfig_vlan7=3D"inet 10.11.19.149 netmask 255.255.255.248 vlan 7 vla= ndev re0" #
When I do not keep space between " and #
ifconfig_vlan7=3D"inet 10.11.19.149 netmask 255.255.255.248 vlan 7 vla= ndev re0"#
rc.conf uses sh(1) syntax, per the man page= :
=A0=A0 =A0 Options are set with ``name=3Dvalue'' assignm= ents that use sh(1) syntax.
=A0=A0 =A0 The following list provides a name and short description fo= r each vari-
=A0=A0 =A0 able that can be set in the rc.conf file:=
(via man 5 rc.conf)

per the POSIX= specification, `#' only denotes a comment if it occurs at the beginnin= g of a word:

When it is not processing= an=A0io_here, the shell shall break its input into tokens by applyi= ng the first applicable rule below to the next character in its input. The = token shall be from the current position in the input until a token is deli= mited according to one of the rules below; the characters forming the token= are exactly those in the input, including any quoting characters. If it is= indicated that a token is delimited, and no characters have been included = in a token, processing shall continue until an actual token is delimited.
[...snip]

10. If the current characte= r is a=A0'#', it and all subsequent characters up to, but = excluding, the next <newline> shall be discarded as a comment. The &l= t;newline> that ends the line is not considered part of the comment.

via: htt= p://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html

In your given example:

"i= net 10.11.19.149 netmask 255.255.255.248 vlan 7 vlandev re0"#

shell is still constructing a word (for assignemnt), which= will result in the assignment of:

inet 10.11.19.149 netmask 255.255.255.248 vlan 7 vlande= v re0#

to=A0ifconfig_vlan.=A0

=
A relevant snippit from "The UNIX Programming Environment" below= :

The metacharacter is almost universally used for shell comments; if a shell word begins with #, the rest of the line is = ignore= d:


$ echo hello # there=A0

hello=A0

$ hello#there=A0

hello#there

$


(page 77)


--
regards,
= matt
--f46d043c07be761be204b63b53d8--