Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Mixing and multiple redirection of stderr/stdout
- X-seq: zsh-users 16038
- From: Aaron Davies <aaron.davies@xxxxxxxxx>
- To: "zsh-users@xxxxxxx" <zsh-users@xxxxxxx>
- Subject: Re: Mixing and multiple redirection of stderr/stdout
- Date: Wed, 18 May 2011 01:13:09 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=eWkvPvjx1zF+Zd91sud5fqA+7lBwQ2ToMNx5w+2swIU=; b=Y6O1Td1Ycsrq4eMZ/LcOJxDFdRUJxUUyvEefR38IiHqzynScd4Z63OsAHK8xvQtT2A GpUmq9gGKBXgvpr02PDhATcBXDdPdOucRLVveNsQuGxsEvDGRt65dY4okfSGPdMrYQDo Kes/L9uh5EXBPgLSr9j50L49JzOYv16BBa6yU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=oHJGKkmIsD/ssVIzpwq49U4Rn5TvGmS8BPCWIsgCkoXoSJwx5F8hVhQF/Sy1ejgAHC Z6I3nz4kST6FJsfi2GIMb9HInsgfizxnriGfDvZvuqhORsQOAGr8xrR4BPbG4aRBA2Yu 1uVi/k+cBbKbjMklQqx8SKq7PCq+NdnNkXqO8=
- In-reply-to: <110517195642.ZM16352@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: <11397254-2D05-4778-8FFC-EA2CCAEA040F@uni-ulm.de> <110517195642.ZM16352@torch.brasslantern.com>
On Tuesday, May 17, 2011, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> The next trick is that zsh has a shorthand operator ">&" (no numbers
> around it) that means "redirect both stdout and stderr at the same
> time". This is done without destroying one of the original streams
> in the way that happens when you use "2>&1". So:
>
> torch% script >&file_mix >file_out 2>file_err
> file_out:STDOUT
> file_mix:STDOUT
> file_mix:STDERR
> file_err:STDERR
>
> And there you are.
Relatedly, can these (or any other) redirections guarantee the same
interleaving of stdout and stderr that would be produced on the
console with no redirections? I've often seen (mostly in other shells,
iirc) that a process which would have, e.g., alternating prints to out
and err, is captured to file as one long block of out followed by one
long block of err.
--
Aaron Davies
aaron.davies@xxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author