Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Rusty Bird Newsgroups: gnu.bash.bug Subject: Re: 'foo > >(bar)' doesn't set $! for external foo not invoked via 'command' Date: Mon, 20 Jul 2020 14:11:19 +0000 Lines: 52 Approved: bug-bash@gnu.org Message-ID: References: <20200719204836.GA1184@mutt> <1659625e-267d-402e-c199-0772820fed79@case.edu> <20200720141119.GA2767@mutt> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Kj7319i9nmIyA2yE" X-Trace: usenet.stanford.edu 1595254291 2891 209.51.188.17 (20 Jul 2020 14:11:31 GMT) X-Complaints-To: action@cs.stanford.edu Cc: =?utf-8?B?T8SfdXo=?= , bug-bash@gnu.org To: Chet Ramey Envelope-to: bug-bash@gnu.org X-EA-Auth: Ut2+BJKed6OJbEkGLGtE0RfM0EIqQGtZa1+2n1RmPBq/WjXb5DQ/ndlcTXxRaTyh4A2QshstcYLN0DaERVIGjrOlzhHy0uFAVsEXf9RbzNk= Mail-Followup-To: Chet Ramey , =?utf-8?B?T8SfdXo=?= , bug-bash@gnu.org Content-Disposition: inline In-Reply-To: <1659625e-267d-402e-c199-0772820fed79@case.edu> Received-SPF: pass client-ip=213.182.54.5; envelope-from=rustybird@net-c.com; helo=relay-2.mailobj.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/20 10:11:24 X-ACL-Warn: Detected OS = Linux 3.1-3.10 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, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: <20200720141119.GA2767@mutt> X-Mailman-Original-References: <20200719204836.GA1184@mutt> <1659625e-267d-402e-c199-0772820fed79@case.edu> Xref: csiph.com gnu.bash.bug:16593 --Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Chet Ramey: > >> Description: > >> $! isn't set to the PID of 'bar' for > >> > >> foo > >(bar) > >> > >> if 'foo' is an external program (as opposed to a builtin or > >> function) - unless it's invoked via 'command'. >=20 > Redirections are performed in the subshell created to execute `foo', so t= he > process substitution is invoked there and can't affect the parent's $!. I guess my question is: Would it not make sense to always perform the redirection before the subshell is created? OTOH, looks like it's trivial to work around the issue by using '{ foo; } > >(bar)'. Rusty --Kj7319i9nmIyA2yE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEhLWbz8YrEp/hsG0ERp149HqvKt8FAl8VpgdfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDg0 QjU5QkNGQzYyQjEyOUZFMUIwNkQwNDQ2OUQ3OEY0N0FBRjJBREYACgkQRp149Hqv Kt9L1BAAlAz7IvQDlYIkyiV2QIsKVIf9bZcdGWmekE6UIjwa12j/Ji0OEVVYAraC TrOFec/bJNH1zWWsSBPkr+X6Fg0rbm3fs5ac/BQ19BZRpMwYUEZ/wEyjDTIlp8Rm bqjBeBnLOjaHrgSnjy13bGlltMOgkWJ/1QEsf+2uo4JA7nJZVbhKhlFAdU8Ku+YK BZOAWveTK8/xgEunF0w2lhgE8ahcF1SaLwJtJohQ4Y13DpPuLt5T0RYdBygCPbHm +m1jP0p/Y7JDcxJwuN84+mKRkpdLjm3SIqW4VhBZWbKP+Z8r3t9O47wF0tslYBpl UiS3YkrMj3noqQHZJtpOey6PQ7kHF/ThYveApIOUzkyOabt3Dy2SV9ityma0FSlO uNPsLaHpBufYFcU4n4Z8erJtYTktxpUNczzgHeg7vJuxrm4DXBN9lkipr3NUk4VG WxFbDXkPCoQlHRiE3dmr9GVmHaAF4VBcrIJqWgscmYngkFUmou44d0QywfInoc6U uE6wIQF7u/VtEN66owSZ7nTzWfEVYGank9hZwUP4ogySQsJZS9uRVxKWdyzmwo// oQCFL9FWeUztLq26qSRpcroAHvw0QWKn3lIZK3CKRVbgW+JGy2u1d6XRzvX7vX+W N4TKXtDX4kYHRW6f9iJBCiNO3Urr60nFw6x7fYJEhvr9dhChvnE= =2eNC -----END PGP SIGNATURE----- --Kj7319i9nmIyA2yE--