0.00user 0.00system 0:01.00elapsed 0%CPU (0avgtext+0avgdata 2176maxresident)k
0inputs+0outputs (0major+179minor)pagefaults 0swaps
......是全球疫苗联盟外部版本tor。
real 0m1.003s
user 0m0.000s
sys 0m0.000s
...is the default output produced by the bash
builtin time
. This builtin version of time
is a bash
extension: a POSIX-compliant shell is not required to provide a builtin version of time
.
然而, POSIX确实规定了一种外部<代码> 时间 通用,该代码可选择<代码>-p,以产生另一种产出格式:
real 1.01
user 0.00
sys 0.00
...and the bash
builtin also accepts the -p
option to produce the same output format.
<代码>bash 封面应当完全用字母进行,条件是文字实际上由<条码>b<>>> >:
$ cat time.sh
#!/bin/bash
time sleep 1
$ ./time.sh
real 0m1.001s
user 0m0.000s
sys 0m0.000s
$
因此,您的文字似乎正在援引外部效用,而不是<条码>bash。
其最可能的原因是:
- your script says
#!/bin/sh
rather than #!/bin/bash
; and
- the
/bin/sh
on your machine is not actually bash
, but a more lightweight POSIX-compliant shell without the bash
extensions (as found on some Linux distributions these days).
The solution is to ensure that the script specifically invokes bash
by using #!/bin/bash
if it relies on bash
extensions.