zsh-users
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-users <zsh-users@zsh.org>
Subject: Re: Redirect output of time builtin
Date: Wed, 13 Jul 2011 08:12:23 -0700	[thread overview]
Message-ID: <110713081223.ZM13059@torch.brasslantern.com> (raw)
In-Reply-To: <1310546182-sup-4650@samurai.icir.org>

On Jul 13,  1:46am, Matthias Vallentin wrote:
} Subject: Re: Redirect output of time builtin
}
} > In order to split the stderr of time from the stderr of the pipeline,
} > you need to get a little trickier:
} > 
} >     { time simple command 2>&3 } 3>&2 2>time.txt
} 
} I was exactly looking for this sort of splitting. What I am wondering is
} whether there is a way to avoid hitting the disk and instead redirect
} the output of time into some piece in memory.

time_out=$( { time simple command 2>&3 >&/dev/tty } 2>&1 3>&2 )

This isn't useful in a pipeline, though, and you may need to replace
>&/dev/tty with explicit shuffling of descriptors 1 and 2, and I don't
promise that interactive commands won't be seriously messed up.


  reply	other threads:[~2011-07-13 15:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-31  0:39 Matthias Vallentin
2011-01-31  4:00 ` Bart Schaefer
2011-07-13  8:46   ` Matthias Vallentin
2011-07-13 15:12     ` Bart Schaefer [this message]
2011-07-19 14:50       ` Matthias Vallentin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=110713081223.ZM13059@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).