[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: time command

From: Sam Steingold
Subject: Re: time command
Date: Tue, 24 Jun 2008 10:47:22 -0400
User-agent: Thunderbird (X11/20080506)

Francis Litterio wrote:
Eric Blake wrote:

According to Yu Cha Yung on 6/23/2008 12:24 AM:
|    time ls > time.txt
|    It doesnt show the information of time in time.txt.

That's because in bash, time is a reserved word, and because time's output
goes to stderr, not stdout.


\time ls >time.txt 2>&1

Or use Bash's builtin "command" command, like this:

        command time ls >time.txt 2>&1

shameless plug:

Subject: rfe: auto-timing

I would like all long-running commands to be auto-timed.
i.e., all commands I type at the prompt should be run as if with "time"
built-in, but if the real or user time is smaller than some value
(specified by the user in an environment variable), the timing output
should be omitted.
keeping the timing of every command costs essentially nothing, so this
may even simplify the code.
an extension of the idea is to keep this timing information in the
history so that one could look up timings for previous commands.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]