Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: capture stderr in command substitution
- X-seq: zsh-users 26411
- From: Axel Beckert <abe@xxxxxxxxxxxxxxx>
- To: Ray Andrews <rayandrews@xxxxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: capture stderr in command substitution
- Date: Sun, 24 Jan 2021 20:47:50 +0100
- Archived-at: <https://zsh.org/users/26411>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-users/2021-01/20210124194750.dtyacd5emjauwxec%40sym.noone.org>
- Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAAAAAC3mUtaAAAABGdBTUEAALGPC/xhBQAAADh0RVh0U29mdHdhcmUAWFYgVmVyc2lvbiAzLjEwYSAgUmV2OiAxMi8yOS85NCAoUE5HIHBhdGNoIDEuMindFS5JAAACGElEQVQ4jXXQMU8UYRDG8f8shNjdDH4AbpfGDjAWlKiJiZ0ajL1aGCvsNCbGaCGG1koLaztaTYz6ATy+gOyehYmF3MxVxgg3FnDsHcTpJr/M+8w7Rf6nCsaVTTDqxbg9hoOXmw83H71+Eyfg4E1d7/Z2fG9rGkZbTQiu+K+3U/C+76lmkvAhJuDndnoAiftou4V84okAGclop4U/jYACZDTxrYWP0gkxVfAm/W//GLZpxIzwIN0Hn8dw0B+IWkZmQmRsj2HfhwokEklHfNCCiQCRgAR7YyhQVRVTCKCzP4Y5zBBE0t0zY3Q8oQaBqqAMlVEcgVQd9706zGirAFium8HXumlMIeMwqQCInju+2+uB6MRENupdpMt8pRlHZyuAW0F+Mb6XSIVqtxjD+iVmVqqystLEzFTGT92YqRaXpNT5eTVjeJhbALPnrTxLUZUKZsgxcNm64hAOYisT/xhF+oKTGU5RegtC3Rt6eEDi/QnIevdTx9Md2EMmYBRmCQR1026FCGQQJJExsRUqgkMGaWSbwYLnoO4T6VgpbQbdELPMBAHWWrhYrcxXnYgAsatPWygkFCBD4K62MAsOTqA6szYRPpsu6e6Y8mPiVrBMNuGIMrgwBUu4p2DgG1Ownu6hpuTv7hScefHAzAC/yRRw5U5pALMbJ4AUALvHSZhxgHPXTsHcdWD1GadAHr9avP+c0wCr7263Df8ASLwXWHWs+KIAAAAHdElNRQfYBQEBODPr
- In-reply-to: <1eb9835c-3911-d4ea-6456-d9ad52ceffea@eastlink.ca>
- List-id: <zsh-users.zsh.org>
- Mail-followup-to: Ray Andrews <rayandrews@xxxxxxxxxxx>, Zsh Users <zsh-users@xxxxxxx>
- Organization: DeuxChevaux.org -- The Citroën 2CV Database
- References: <1eb9835c-3911-d4ea-6456-d9ad52ceffea@eastlink.ca>
Hi,
On Sun, Jan 24, 2021 at 11:45:31AM -0800, Ray Andrews wrote:
> $ var=$(command)
>
> ... but $var doesn't pick up errors. Can it be forced?
I'd expect
$ var=$(command 2>&1)
to do that.
Kind regards, Axel
--
PGP: 2FF9CD59612616B5 /~\ Plain Text Ribbon Campaign, http://arc.pasp.de/
Mail: abe@xxxxxxxxxxxxxxx \ / Say No to HTML in E-Mail and Usenet
Mail+Jabber: abe@xxxxxxxxx X
https://axel.beckert.ch/ / \ I love long mails: https://email.is-not-s.ms/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author