From owner-svn-src-all@freebsd.org Fri Jan 11 21:07:05 2019 Return-Path: Delivered-To: svn-src-all@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 136C9149D892; Fri, 11 Jan 2019 21:07:05 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87855881B9; Fri, 11 Jan 2019 21:07:04 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x0BL6wUq023064; Fri, 11 Jan 2019 13:06:58 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id x0BL6wAd023063; Fri, 11 Jan 2019 13:06:58 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901112106.x0BL6wAd023063@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r342945 - in head: tools/build/mk usr.sbin/bluetooth usr.sbin/bluetooth/bluetooth-config In-Reply-To: To: Enji Cooper Date: Fri, 11 Jan 2019 13:06:58 -0800 (PST) CC: Warner Losh , Devin Teske , "Rodney W. Grimes" , Lars Engels , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 87855881B9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.981,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2019 21:07:05 -0000 > > > On Jan 11, 2019, at 12:36 PM, Warner Losh wrote: > > ... > > > I talked about this at BSDCan in June. $foo is preferred (there > > *is* a difference) and, as you say, if a file is consistently ${foo} > > then it is fine. > > > > I prefer {} because $foo:bar doesn't work while ${foo}:bar does. Actually I think $foo:bar works... But what does not work is when you want to glue foo to something without intervening special characters. # foo=FOO # echo $foobar # echo ${foo}bar FOObar # echo $foo:bar FOO:bar > > I think the form Warner brings up makes more sense to sh(1) newcomers who might not know the intricacies of the grammar. Similar rules apply to perl and other languages as well when it comes to variable expansion and such. > Thank you, > -Enji I personally do prefer the ${foo} form as iirc it always works and you dont have to remeber the special rules, where as the other form does not always work and you end up using the {} form to fix when it does not, this leading to files with mixed form, which, imho, is ok, but messy. It also makes it easy to search and sed for variables and not get things you didnt want due to common root names in variables. I can easily explicity find variable ${foo} very easy and not have to stop at all the ${foobar} variables. I do understand that for many people the {} are unneeded noise characters. -- Rod Grimes rgrimes@freebsd.org