Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
How do I accomplish this?
- X-seq: zsh-users 22427
- From: Kannan Varadhan <kvaradhan3@xxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: How do I accomplish this?
- Date: Thu, 26 Jan 2017 12:19:10 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=S8dFpSteC7UDKCHyBrtI9z8Tx6visflYySXGLj/KbS0=; b=cjiSsErBabubUTBF2S5FBrBfRsl55FUz077hjRrFFQb9LJ43SvEznRIFBMfwasvrrJ Av8HEIVmpXSZIEe7xvM29NMwYk2h0KaaOEUWU7Hstx84wNGx0E9QipEc57jxzrKGTO5J 0JyY1fW6lFws0MYpLW3CHgZLFSrJb9NWYatSjDOzCUMEMIFA7oHqqti8IcVmekWtnhnE 3Yyle5z55kSPlqGA8rOMDYJqGxGyfKwWS94bXTLixnsMwriWe4W55rv/R1nqAJjhOXjM azlvwT89c+ywfZt0Dg1jQxFtqy950ChfepE34ckC7eKgJ6b6jbpEu+43hOSm/RY+q0oU FvTg==
- 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
Some of the commands I run seem to take a long time, but also varying
amounts of time.
I'd like to prefix "time" to every command that runs. So that,
when I type:
% make long-running-target
I'd like to see the equivalent of:
% time make long-running-target
...
make long-running-target 0.00s user 0.00s system 66% cpu 0.004
total
I thought preexec() might help:
preexec() {
set $3
eval time "$@"
}
but this ends up running the same command twice, once timed, and once
without.
Kannan
Messages sorted by:
Reverse Date,
Date,
Thread,
Author