जब बैश/zsh निम्नलिखित करता है क्या हो रहा है:शैल निष्पादन: समय बनाम/usr/bin/समय
~ » /usr/bin/time -l sleep 1
1.00 real 0.00 user 0.00 sys
516096 maximum resident set size
0 average shared memory size
0 average unshared data size
0 average unshared stack size
145 page reclaims
0 page faults
0 swaps
0 block input operations
0 block output operations
0 messages sent
0 messages received
0 signals received
0 voluntary context switches
2 involuntary context switches
------------------------------------------------------------
~ » time -l sleep 1
zsh: command not found: -l
-l sleep 1 0.00s user 0.00s system 52% cpu 0.001 total
------------------------------------------------------------
~ » /usr/bin/time foo
foo: No such file or directory
0.00 real 0.00 user 0.00 sys
------------------------------------------------------------
~ » time foo
zsh: command not found: foo
foo 0.00s user 0.00s system 52% cpu 0.001 total
यह एक फर्क कैसे मैं समय का उपयोग क्यों पड़ता है, और क्यों zsh की कोशिश कर रहा है -l
निष्पादित करने के लिए ??
मजे की बात है, zsh कहते
~ » which time
time: shell reserved word
बैश नहीं करता है:
~ » bash
bash-3.2$ which time
/usr/bin/time
bash-3.2$ time foo
bash: foo: command not found
real 0m0.006s
user 0m0.000s
sys 0m0.003s
bash-3.2$ /usr/bin/time foo
foo: No such file or directory
0.00 real 0.00 user 0.00 sys
bash-3.2$ time -l sleep 1
bash: -l: command not found
real 0m0.001s
user 0m0.000s
sys 0m0.001s
bash-3.2$ /usr/bin/time -l sleep 1
1.00 real 0.00 user 0.00 sys
516096 maximum resident set size
0 average shared memory size
0 average unshared data size
0 average unshared stack size
144 page reclaims
0 page faults
0 swaps
0 block input operations
1 block output operations
0 messages sent
0 messages received
0 signals received
2 voluntary context switches
2 involuntary context switches
'मैन टाइम'/manr/bin/time के लिए मैन पेज को क्यों चालू करता है, और अंतर्निहित समय के लिए हम मैन पेज को कैसे देखते हैं, यदि यह मौजूद है? – emish
@emish: बिल्टिन के लिए कोई अलग मैन पेज नहीं हैं; वे उस शैल के हिस्से के रूप में दस्तावेज किए जाते हैं, जिसमें वे अंतर्निहित हैं। 'बाश' में, आप बिल्टिन के बारे में जानकारी प्राप्त करने के लिए 'सहायता' अंतर्निहित का उपयोग कर सकते हैं। 'Zsh' वितरण में 'मैन zshbuiltins' शामिल है। मुझे लगता है कि 'डैश' बिल्टिन के लिए एकमात्र दस्तावेज 'मैन डैश' मैनपेज में है। – rici
@emish आप बिल्टिन के लिए 'सहायता समय' भी आज़मा सकते हैं। – gerrit