time命令的问题
发表于 : 2010-03-02 21:31
#!/bin/bash
tf1="testfile1"
tf2="testfile2"
tf3="testfile3"
tp1="./method_one"
tp2="./method_two"
tp3="./method_three"
size1="1"
size2="256"
size3="16*1024"
time -o testreslut ${tp1} ${size1} ${tf1}
time -a testresult ${tp1} ${size1} ${tf2}
运行后:
heyangya@heyangya-laptop:~/task1$ ./test
./test: line 11: -o:找不到命令
real 0m0.001s
user 0m0.000s
sys 0m0.000s
./test: line 12: -a:找不到命令
real 0m0.001s
user 0m0.004s
sys 0m0.004s
这是为什么呢?
还有,我怎么才能在shell中得到time的结果呢,要测试三次然后求平均值。。。
tf1="testfile1"
tf2="testfile2"
tf3="testfile3"
tp1="./method_one"
tp2="./method_two"
tp3="./method_three"
size1="1"
size2="256"
size3="16*1024"
time -o testreslut ${tp1} ${size1} ${tf1}
time -a testresult ${tp1} ${size1} ${tf2}
运行后:
heyangya@heyangya-laptop:~/task1$ ./test
./test: line 11: -o:找不到命令
real 0m0.001s
user 0m0.000s
sys 0m0.000s
./test: line 12: -a:找不到命令
real 0m0.001s
user 0m0.004s
sys 0m0.004s
这是为什么呢?
还有,我怎么才能在shell中得到time的结果呢,要测试三次然后求平均值。。。