Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Is it possible to capture stdout and stderr to separate variables in Zsh?
- X-seq: zsh-users 16936
- From: Nikolai Weibull <now@xxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Is it possible to capture stdout and stderr to separate variables in Zsh?
- Date: Fri, 30 Mar 2012 09:15:57 +0200
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=MMHpdzV8fOyG4cC2zLI9H4hgQaKj9PzUXbd7z9hBdcE=; b=xptANpW0JuWc99TPqHcTkMcj9HF+OIeCqWALvg++LX18OaXa0eAr3Pv2BLvgLdqhAz 9ObhXjpvickFm2K7ZVAMVkj3+Rd4uVx0MyP3nf+TAO1Tv+GwhoJ6f2fVSk3ryGv4ugEH VsOLC5PDi5xvD0tjkla0LFmmGjove0+pPRSAgxF80ZBJbNKiIHWXrp7ww6Zv9xyJNpje z6zsob0l3LPhUNuoneitr5Qb01YwKZUpGDxwrJr+KU0W1+R3XVwEb++XmJ4qRgvfFDXH 4HiCFK7znl+CqMv/moWTfgl0NmK9Ye0R8BJr3dqwfGOAxOKujXMBgOjoHn5UoK6L3Ftl CAvA==
- In-reply-to: <120308065332.ZM14313@torch.brasslantern.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CADdV=Mtbszh2NjtB8yFjfeo9PR1U7XV-Qi2AQMXCZ0Ag0VTS+w@mail.gmail.com> <1331054185.27052.19.camel@air.fifi.org> <120306230111.ZM11639@torch.brasslantern.com> <CADdV=MthDr4RZhO1pUni9qW5S2j1H_xu7iQOBTAs=vP84Gei8Q@mail.gmail.com> <120308065332.ZM14313@torch.brasslantern.com>
- Sender: nikolai.weibull@xxxxxxxxx
On Thu, Mar 8, 2012 at 15:53, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Mar 7, 10:26am, Nikolai Weibull wrote:
> }
> } outs=("${(@0):-"$({ out=$(x) } 2>&1; print $'\0'$out$'\0'$status)"}")
>
> That's nice. You can solve the problem that Philippe mentioned with
> loss of trailing newlines, by embedding one NUL in $out like so:
>
> outs=("${(@0):-"$({ out="$(x; print -n $'\0')" } 2>&1;
> print $'\0'$out$status)"}")
That will, however, override the value of $status.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author