Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: capture stderr in command substitution



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