Path: csiph.com!goblin2!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: =?utf-8?Q?Lawrence_Vel=C3=A1zquez?= Newsgroups: gnu.bash.bug Subject: Re: set -u not working as expected Date: Sun, 2 Aug 2020 03:34:23 -0400 Lines: 37 Approved: bug-bash@gnu.org Message-ID: References: <000301d66834$588493c0$098dbb40$@kalvr.net> <1867D8FC-85DD-4406-A239-3002913493AB@larryv.me> <61B2CB9D-3978-4872-B88A-1542CF95B5B9@larryv.me> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.15\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1596353671 9559 209.51.188.17 (2 Aug 2020 07:34:31 GMT) X-Complaints-To: action@cs.stanford.edu Cc: "bug-bash@gnu.org" , Kristof Burek To: =?utf-8?B?T8SfdXo=?= Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=larryv.me; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm1; bh=Z 9RilVHG0R8UdahQaEL9bK2EOr1h7Ctua5UnPzYG7+I=; b=YPbXK8zoX8cqsmTjY Rd+Vcm8geQJ8HQoyDWeQy6fCV9mNKS+UVt2W+l6eAJJWne/vktVb+uf52ikYY+Sq KsWinXdOLEhaKpe6ygsXxtkRoAQj9VNO4HyT3/g8OWHeiml0XjMv9A5EnXFqCcRc o1e4hsL9QJnyE9gA4rU1FKEiSWsH7VsfyM3vgtlKbYfEo3s0liofj2L65FP4YmMi 4On3vmthVoRh1LQPopSqGIBkiB2OTsPIht6sa2kbcwDA/k2dVnlU5Y2aGp0EBWxa 1WOWjAWqLefYf/JYZSrpMVPDg2aZg0JYlYZvAid43qOV981a9tAkPVJGLzrxsV/O kF9wg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=Z9RilVHG0R8UdahQaEL9bK2EOr1h7Ctua5UnPzYG7 +I=; b=dWgauc3ymNjOmM53o6QqXp+maz4Mo0BvZoaFBZlSxjHrxZlJiqLCUPDAQ GVsRhob/vNyexpp4vk0kUXL9xB0kHIDMB8pr+FPWSYC35HwXHMN7Gy06bm1dImwK IoOO4Wu4WBR23MRMWM8ldbTpQSvPsVQnjHX6b4xM/2b8TLrMVvuUCSaOfINukQbR biBiawb+MZvG2c/yQvkWtmsyh5mfhxv/s2LPkFTkJtdEw3xMLCWgn/3qNPAPgopl ow/ebbnvH+qEHyQ4q/TNBTV739kiMH5vk8zQgkgrRTk1y3WK4c2KatA2GSLzcL/+ +OXL/mK5zIxIw+7oNj2oYJCBjC4bg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrjedugdduvddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpegtggfuhfgjfffgkfhfvffosehtqh hmtdhhtdejnecuhfhrohhmpefnrgifrhgvnhgtvggpgggvlhojiihquhgviicuoehvqhes lhgrrhhrhihvrdhmvgeqnecuggftrfgrthhtvghrnhepudekjedtleehvdduhfevleegte ffteekhedvheejteelffdvgedtjedvueeugeeinecukfhppedujedvrdehkedrvddvjedr ieejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepvh hqsehlrghrrhihvhdrmhgv X-ME-Proxy: In-Reply-To: X-Mailer: Apple Mail (2.3445.104.15) Received-SPF: pass client-ip=64.147.123.24; envelope-from=vq@larryv.me; helo=wout1-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/02 03:34:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <61B2CB9D-3978-4872-B88A-1542CF95B5B9@larryv.me> X-Mailman-Original-References: <000301d66834$588493c0$098dbb40$@kalvr.net> <1867D8FC-85DD-4406-A239-3002913493AB@larryv.me> Xref: csiph.com gnu.bash.bug:16674 > On Aug 2, 2020, at 2:51 AM, O=C4=9Fuz = wrote: >=20 > `u' has no members, so there's nothing to expand. If you use `${u[0]}' = for > example, you'll see an error, I think how bash and ksh behave is = perfectly > reasonable. Agreed. Their behavior logically follows from POSIX's carveout for $@. >> % bash -c 'set -u; typeset -i v; printf "<%s>\\n" "$v"' >> bash: v: unbound variable >> % ksh -c 'set -u; typeset -i v; printf "<%s>\\n" "$v"' >> ksh: v: parameter not set >> % zsh -c 'set -u; typeset -i v; printf "<%s>\\n" "$v"' >> <0> >>=20 >>=20 > `typeset -i v' doesn't assign `v', just gives it the integer = attribute. > Again, I can't see any problem with bash and ksh here. Also agreed, but I was more interested in the next part... >> % bash -c 'set -u; typeset -i v; v+=3D1; printf "<%s>\\n" "$v"' >> <1> >> % ksh -c 'set -u; typeset -i v; v+=3D1; printf "<%s>\\n" "$v"' >> <1> >> % zsh -c 'set -u; typeset -i v; v+=3D1; printf "<%s>\\n" "$v"' >> <1> ...which contrasts with the behavior of let. Someone else will have to explain this, as I don't know what to make of it. vq=