svn commit: r334221 - head/etc

Ian Lepore ian at freebsd.org
Mon Jun 11 22:42:29 UTC 2018


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


More information about the svn-src-head mailing list