<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jun 6, 2014 at 1:58 PM, Vincent <span dir="ltr">&lt;<a href="mailto:vince@macports.org" target="_blank">vince@macports.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="">&gt; With the quotes. Pedantically ${1+&quot;$@&quot;} is most correct, but (a) I suspect the case that protects against would fail anyway, and (b) on OS X /bin/sh is bash which handles &quot;$@&quot; as if it were ${1+&quot;$@&quot;}. (I do wonder how long before Apple abandons bash though....)<br>

<br>
</div>I must admit I fail to see what ${1+“$@”} exactly refers to…<br></blockquote></div><div><br></div><div>In classic Bourne shell, &quot;$@&quot; produces a single empty quoted string if there are no shell parameters. ${1+&quot;$@&quot;} means &quot;expand &quot;$@&quot; if and only if $1 is set, even if it is set to an empty string&quot;. The Korn shell (specifically ksh93, IIRC) introduced the interpretation of &quot;$@&quot; that bash uses.</div>
<div><br></div><div>As the Korn shell is open source now, it would not surprise me if that replaced bash at some point, should Apple decide it needs a newer shell than a GPL2-ed bash. zsh also has a permissive license (although some contributed scripts are GPL; I haven&#39;t checked the version) and might also be an alternative.</div>
<div><br></div>-- <br><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div>
<div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div>
</div></div>