From owner-svn-src-head@freebsd.org Mon Jun 11 22:42:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B11D31007F5A for ; Mon, 11 Jun 2018 22:42:29 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DC3E82A5D for ; Mon, 11 Jun 2018 22:42:29 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: b2f4ad1f-6dc8-11e8-b829-b3adae557cda X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id b2f4ad1f-6dc8-11e8-b829-b3adae557cda; Mon, 11 Jun 2018 22:42:20 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w5BMgJMv055970; Mon, 11 Jun 2018 16:42:19 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1528756939.12122.40.camel@freebsd.org> Subject: Re: svn commit: r334221 - head/etc From: Ian Lepore To: Mark Felder , Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 11 Jun 2018 16:42:19 -0600 In-Reply-To: <1528756176.557409.1404618352.33DD9A15@webmail.messagingengine.com> References: <201805251936.w4PJaQIf093393@repo.freebsd.org> <20180527060917.GA3179@FreeBSD.org> <1528756176.557409.1404618352.33DD9A15@webmail.messagingengine.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jun 2018 22:42:29 -0000 On Mon, 2018-06-11 at 17:29 -0500, Mark Felder wrote: > > On Sun, May 27, 2018, at 01:09, Alexey Dokuchaev wrote: > > > > On Fri, May 25, 2018 at 07:36:26PM +0000, Mark Felder wrote: > > > > > > New Revision: 334221 > > > URL: https://svnweb.freebsd.org/changeset/base/334221 > > > > > > Log: > > >   rc.subr: Support loading environmental variables from a file > > >    > > > + if [ -n "$_env_file" ] && [ -r "${_env_file}" ]; then > > Style bug: "$_env_file" vs. "${_env_file}".  Also, isn't the -n > > check > > redundant? > The entire rc.subr file seems to be full of style inconsistencies. > I'd take the time to fix it if there would be no objections. As per > redundancy, it's copy+paste of what mat suggested. I suppose the -r > will fail if the variable is not set, so it would indeed be > redundant. I didn't think of it that way. > That will work as long as there are quotes around the arg to -r: $ foo="" $ [ -r ${foo} ] && echo good good $ [ -r "${foo}" ] && echo good $  Same results if $foo is unset. -- Ian