Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Apr 2011 17:17:26 -0700
From:      Jeremy Chadwick <freebsd@jdc.parodius.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: ZFS vs OSX Time Machine
Message-ID:  <20110430001726.GA58981@icarus.home.lan>
In-Reply-To: <201104290925.03607.jhb@freebsd.org>
References:  <537A8F4F-A302-40F9-92DF-403388D99B4B@gsoft.com.au> <201104281727.04425.jhb@freebsd.org> <20110428215954.GA34030@icarus.home.lan> <201104290925.03607.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Apr 29, 2011 at 09:25:03AM -0400, John Baldwin wrote:
> On Thursday, April 28, 2011 5:59:54 pm Jeremy Chadwick wrote:
> > I've seen cases where entries in /boot/loader.conf throw parser errors
> > during loader(8) when quotes aren't used.  The man page denotes that
> > quotes are required, which doesn't appear to be true?  Possibly the
> > parser only throws errors if non-numeric/non-integer values (e.g.
> > strings) are specified without quotes.
> > 
> > It's interesting that in the BUGS section of the man page the syntax
> > shown for hw.ata.ata_dma=0 also ""violates"" the ""required"" syntax.
> 
> Yes, it's confusing.  My gut instinct is that quotes are only required
> if the value contains whitespace.  I've certainly used
> 'autoboot_delay=NO' without quotes before.
> 
> I just did some tests and it looks like quotes are only required for
> values that contain whitespace, so
> 
> foo=bar
> bar=42G
> baz="foo bar"
> 
> are fine, but
> 
> baz=foo bar
> 
> will fail.
> 
> This is similar to normal shell syntax for assigning to variables.

As usual, thanks for the time you spent checking this out and verifying
what reality is.  :-)  I'll file a PR to get the man page updated to
reflect things.

I believe what I've seen (re: parsing errors) is the latter case example
you provided (baz=foo bar).  So it seems that using quotes is the
overall "safety mechanism" to ensure the value will work, but they're
not required.

-- 
| Jeremy Chadwick                                   jdc@parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.               PGP 4BD6C0CB |




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110430001726.GA58981>