Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • 1
    ooh, I didn't realize. I knew time writes to stderr, but I didn't realize that it would merge stdout and stderr of the executed command into its stdout. But generally there is no direct method (i.e. without intermediate file)? +1. Commented Apr 26, 2011 at 19:57
  • 3
    @STATUS_ACCESS_DENIED: time does not merge its command's stdout and stderr. The way I showed assumed that you only needed the command's stdout output. Since bash will only store what comes out of stdout, you have to redirect. In case you can safely drop your command's stderr: the time will always be on the last line of stderr. If you do need both your command's output streams, I'd suggest wrapping it in another script. Commented Apr 26, 2011 at 20:27