Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: worley@alum.mit.edu (Dale R. Worley) Newsgroups: gnu.bash.bug Subject: Re: local failure Date: Thu, 28 May 2020 22:43:42 -0400 Lines: 16 Approved: bug-bash@gnu.org Message-ID: References: (lpicquet@gmail.com) <87tuzzh34x.fsf@hobgoblin.ariadne.com> NNTP-Posting-Host: lists.gnu.org X-Trace: usenet.stanford.edu 1590720242 15918 209.51.188.17 (29 May 2020 02:44:02 GMT) X-Complaints-To: action@cs.stanford.edu Cc: bug-bash@gnu.org, bash@packages.debian.org To: Laurent Picquet Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcastmailservice.net; s=20180828_2048; t=1590720236; bh=iRaaG+E7ru6Rop4cJMltt7y4P/zvFDoStdla4Oo6BfA=; h=Received:Received:Received:Received:From:To:Subject:Date: Message-ID; b=nMhdi0rthPEzgOMpLZQZzlagOrkcapZxwqYouu44H1s4Cz6Q+3pX9Xknb9Uk0iu4/ It5q99pJjhUhzcL54fS/OrO5WiOdjJxAMB42AiRFUg/1qBsRaAxMDKhobIOpeutK7H X3scE3p9sQyIbL2vjaTgGIelG/UvfQR3hUAUp8IL01AKIsdE0oESS9d81N5A6mGO4J 5CZdpZXAHxAZYmWykGxtnrhCn8FjQ3TGbGpS0DS4zr3jObPTuafdQDi3MZHcflSvdI VqZ02D1+rcg6ZgMO0o1SKWnSZ2IizH5DRCU3kSnUHXetpwqfC/gtjln2U/LAp4Kvwm hVsOHUSEwM3PQ== X-Xfinity-VMeta: sc=-100.00;st=legit X-Authentication-Warning: hobgoblin.ariadne.com: worley set sender to worley@alum.mit.edu using -f In-Reply-To: (lpicquet@gmail.com) Received-SPF: permerror client-ip=2001:558:fe21:29:69:252:207:42; envelope-from=worley@alum.mit.edu; helo=resqmta-ch2-10v.sys.comcast.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 22:43:56 X-ACL-Warn: Detected OS = ??? X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, T_SPF_PERMERROR=0.01, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: <87tuzzh34x.fsf@hobgoblin.ariadne.com> Xref: csiph.com gnu.bash.bug:16314 It's a subtle point. See this paragraph in the bash manual page: If there is a command name left after expansion, execution proceeds as described below. Otherwise, the command exits. If one of the expansions contained a command substitution, the exit status of the command is the exit status of the last command substitution performed. If there were no command substitutions, the command exits with a status of zero. In one of your examples, a "local" command is generated using a command substitution, so the exit status is that of the local command. In the other, only an assignment is done, which is not a command, so the exit status is that of the last command substitution. Dale