Is quoting necessary in /etc/rc.conf ?
ekarkkai at pp.htv.fi
Sun Aug 6 12:17:49 UTC 2017
On Sun, Aug 06, 2017 at 11:00:03AM +0000, Manish Jain wrote:
> On my system, it works whether I put either of the following in rc.conf:
The "xyz_enable" shell environment variable is most likely checked by
checkyesno function, which is sourced from /etc/rc.subr file.
> Just wished to check whether an unquoted YES is completely equivalent
> (and accepted) as a quoted YES ?
When the environment variables value does not contain certain
characters, like a space, then there is no functional difference
betwween a quoted YES and a nonquoted YES strings, in this case.
The shells use space as argument separator. Below is a simple shell
script that shows the number of arguments given to it.
$ cat demo.sh
There are five examples:
$ ./demo.sh "YES"
$ ./demo.sh YES
$ ./demo.sh "NO"
$ ./demo.sh NO
$ ./demo.sh "YES NO"
$ ./demo.sh YES NO
"In the beginning the Universe was created. This has made a lot of
people very angry and been widely regarded as a bad move."
-- Douglas Adams 1952 - 2001
More information about the freebsd-questions