Why Zsh `time` not work for some commands?`time echo` got no outputZSH autocompletion gives seemingly random...

A stranger from Norway wants to have money delivered to me

If a Contingency spell has been cast on a creature, does the Simulacrum spell transfer the contingent spell to its duplicate?

Why did the RAAF procure the F/A-18 despite being purpose-built for carriers?

How quickly could a country build a tall concrete wall around a city?

Best way to divide CPU along all sql instances on 1 server

Y2K... in 2019?

Non-OR journals which regularly publish OR research

What are these two charactes marked red

Why aren’t emergency services using callsigns?

Who are these characters/superheroes in the posters from Chris's room in Family Guy?

Accidentals - some in brackets, some not

Dereferencing a pointer in a 'for' loop initializer creates a segmentation fault

What is my malfunctioning AI harvesting from humans?

Word or idiom defining something barely functional

Ex-contractor published company source code and secrets online

English - Acceptable use of parentheses in an author's name

What word can be used to describe a bug in a movie?

Can I legally make a real mobile app based on a fictional app from a TV show?

Best gun to modify into a monsterhunter weapon?

Why are Gatwick's runways too close together?

Max Order of an Isogeny Class of Rational Elliptic Curves is 8?

What does Apple mean by "This may decrease battery life"?

Performance of a branch and bound algorithm VS branch-cut-heuristics

'sudo apt-get update' get a warning



Why Zsh `time` not work for some commands?


`time echo` got no outputZSH autocompletion gives seemingly random errors after some timeWhy my tabs are not expanding in TIMEFORMAT?Stable timing for shell scripts?Why does `zip` in a for loop work when the file exists, but not when it doesn't?How to set dd/mm/yy for command-prompt in zsh?Bash time keyword result only with second piped command, explain whyLinux History Expansion escaping colon which is not mean as a modifier (in zsh)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1















Why Zsh time not work for some commands,



➜  ~ type time
time is a reserved word
➜ ~ time sleep 1
sleep 1 0.00s user 0.00s system 0% cpu 1.004 total
# not work for echo
➜ ~ time echo hello
hello
# not work with for
➜ ~ time for i in {1..3}; do curl -s http://baidu.com > /dev/null; done


but if change to bash these commands are both supported,



➜  ~ exec bash
bash-3.2$ type time
time is a shell keyword
$ time echo hello
hello

real 0m0.000s
user 0m0.000s
sys 0m0.000s

bash-3.2$ time for i in {1..3}; do curl -s http://baidu.com > /dev/null; done

real 0m0.099s
user 0m0.019s
sys 0m0.018s









share|improve this question

























  • Possible duplicate of `time echo` got no output

    – muru
    53 mins ago


















1















Why Zsh time not work for some commands,



➜  ~ type time
time is a reserved word
➜ ~ time sleep 1
sleep 1 0.00s user 0.00s system 0% cpu 1.004 total
# not work for echo
➜ ~ time echo hello
hello
# not work with for
➜ ~ time for i in {1..3}; do curl -s http://baidu.com > /dev/null; done


but if change to bash these commands are both supported,



➜  ~ exec bash
bash-3.2$ type time
time is a shell keyword
$ time echo hello
hello

real 0m0.000s
user 0m0.000s
sys 0m0.000s

bash-3.2$ time for i in {1..3}; do curl -s http://baidu.com > /dev/null; done

real 0m0.099s
user 0m0.019s
sys 0m0.018s









share|improve this question

























  • Possible duplicate of `time echo` got no output

    – muru
    53 mins ago














1












1








1








Why Zsh time not work for some commands,



➜  ~ type time
time is a reserved word
➜ ~ time sleep 1
sleep 1 0.00s user 0.00s system 0% cpu 1.004 total
# not work for echo
➜ ~ time echo hello
hello
# not work with for
➜ ~ time for i in {1..3}; do curl -s http://baidu.com > /dev/null; done


but if change to bash these commands are both supported,



➜  ~ exec bash
bash-3.2$ type time
time is a shell keyword
$ time echo hello
hello

real 0m0.000s
user 0m0.000s
sys 0m0.000s

bash-3.2$ time for i in {1..3}; do curl -s http://baidu.com > /dev/null; done

real 0m0.099s
user 0m0.019s
sys 0m0.018s









share|improve this question














Why Zsh time not work for some commands,



➜  ~ type time
time is a reserved word
➜ ~ time sleep 1
sleep 1 0.00s user 0.00s system 0% cpu 1.004 total
# not work for echo
➜ ~ time echo hello
hello
# not work with for
➜ ~ time for i in {1..3}; do curl -s http://baidu.com > /dev/null; done


but if change to bash these commands are both supported,



➜  ~ exec bash
bash-3.2$ type time
time is a shell keyword
$ time echo hello
hello

real 0m0.000s
user 0m0.000s
sys 0m0.000s

bash-3.2$ time for i in {1..3}; do curl -s http://baidu.com > /dev/null; done

real 0m0.099s
user 0m0.019s
sys 0m0.018s






zsh time oh-my-zsh






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 1 hour ago









zhuguoweizhuguowei

1363 bronze badges




1363 bronze badges
















  • Possible duplicate of `time echo` got no output

    – muru
    53 mins ago



















  • Possible duplicate of `time echo` got no output

    – muru
    53 mins ago

















Possible duplicate of `time echo` got no output

– muru
53 mins ago





Possible duplicate of `time echo` got no output

– muru
53 mins ago










0






active

oldest

votes














Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f534950%2fwhy-zsh-time-not-work-for-some-commands%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f534950%2fwhy-zsh-time-not-work-for-some-commands%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...