From owner-freebsd-questions@freebsd.org Sun Aug 6 12:17:49 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E20EDD6BCE for ; Sun, 6 Aug 2017 12:17:49 +0000 (UTC) (envelope-from ekarkkai@pp.htv.fi) Received: from welho-filter3.welho.com (welho-filter3.welho.com [83.102.41.25]) by mx1.freebsd.org (Postfix) with ESMTP id EB7F383DCD for ; Sun, 6 Aug 2017 12:17:48 +0000 (UTC) (envelope-from ekarkkai@pp.htv.fi) Received: from localhost (localhost [127.0.0.1]) by welho-filter3.welho.com (Postfix) with ESMTP id 5063751B31 for ; Sun, 6 Aug 2017 15:08:21 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at pp.htv.fi Received: from welho-smtp3.welho.com ([IPv6:::ffff:83.102.41.86]) by localhost (welho-filter3.welho.com [::ffff:83.102.41.25]) (amavisd-new, port 10024) with ESMTP id JHwEtK7W0OaP for ; Sun, 6 Aug 2017 15:08:20 +0300 (EEST) Received: from zero.my.domain (87-100-138-79.bb.dnainternet.fi [87.100.138.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by welho-smtp3.welho.com (Postfix) with ESMTPS id C8D4F2318 for ; Sun, 6 Aug 2017 15:08:19 +0300 (EEST) Received: from thunderbolt.my.domain (thunderbolt.my.domain [10.192.168.30]) by zero.my.domain (8.15.2/8.15.2) with ESMTPS id v76C8DYk099998 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Sun, 6 Aug 2017 15:08:19 +0300 (EEST) (envelope-from ekarkkai@pp.htv.fi) Received: from thunderbolt.my.domain (localhost [127.0.0.1]) by thunderbolt.my.domain (8.15.2/8.15.2) with ESMTPS id v76C8DkD037296 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 6 Aug 2017 15:08:13 +0300 (EEST) (envelope-from ejk@thunderbolt.my.domain) Received: (from ejk@localhost) by thunderbolt.my.domain (8.15.2/8.15.2/Submit) id v76C8CLa037295 for freebsd-questions@freebsd.org; Sun, 6 Aug 2017 15:08:12 +0300 (EEST) (envelope-from ejk) Date: Sun, 6 Aug 2017 15:08:12 +0300 From: Esa Karkkainen To: freebsd-questions@freebsd.org Subject: Re: Is quoting necessary in /etc/rc.conf ? Message-ID: <20170806120812.GE51805@pp.htv.fi> Mail-Followup-To: Esa Karkkainen , freebsd-questions@freebsd.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Aug 2017 12:17:49 -0000 On Sun, Aug 06, 2017 at 11:00:03AM +0000, Manish Jain wrote: > > Hi, Hi, > On my system, it works whether I put either of the following in rc.conf: > > xyz_enable="YES" > > Or, > > xyz_enable=YES > 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 #!/bin/sh echo $# There are five examples: $ ./demo.sh "YES" 1 $ ./demo.sh YES 1 $ ./demo.sh "NO" 1 $ ./demo.sh NO 1 $ ./demo.sh "YES NO" 1 $ ./demo.sh YES NO 2 Esa -- "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