Path: csiph.com!goblin3!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Greg Wooledge Newsgroups: gnu.bash.bug Subject: Re: Command substitution Date: Wed, 3 Jun 2020 07:19:22 -0400 Lines: 21 Approved: bug-bash@gnu.org Message-ID: References: <87mu5kgbxu.fsf@hobgoblin.ariadne.com> <20200603111922.GY4133@eeg.ccf.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: usenet.stanford.edu 1591183197 24581 209.51.188.17 (3 Jun 2020 11:19:57 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org Mail-Followup-To: bug-bash@gnu.org Content-Disposition: inline In-Reply-To: <87mu5kgbxu.fsf@hobgoblin.ariadne.com> User-Agent: Mutt/1.10.1 (2018-07-13) Received-SPF: none client-ip=139.137.100.1; envelope-from=wooledg@eeg.ccf.org; helo=mail.eeg.ccf.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/06/03 07:19:22 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9 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: <20200603111922.GY4133@eeg.ccf.org> X-Mailman-Original-References: <87mu5kgbxu.fsf@hobgoblin.ariadne.com> Xref: csiph.com gnu.bash.bug:16360 On Tue, Jun 02, 2020 at 09:44:45PM -0400, Dale R. Worley wrote: > Naively, I expect that > FOO="$( command2 )" > command1 "$FOO" > > has the same effect as > > command1 "$( command2 )" > > Has anyone pushed the boundaries of this and can tell me whether there > are gotchas? The main case where people care about the difference is when set -e is in effect. Otherwise, no, most people do not care. If they cared, they would be checking the exit status of command2 themselves, rather than simply letting the shell proceed. (And set -e should never be in effect. But people don't listen when we tell them that, so that situation persists.)