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 _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"