#!/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的结果呢,要测试三次然后求平均值。。。
time命令的问题
- cnchyan
- 帖子: 106
- 注册时间: 2005-06-19 23:33
Re: time命令的问题
man time
Users of the bash shell need to use an explicit path in order to run
the external time command and not the shell builtin variant.
Users of the bash shell need to use an explicit path in order to run
the external time command and not the shell builtin variant.
Ubuntu Karmic
acer 5595 : core2 duo T7200;2*1024M DDR2-667 ;intel 965pm;ati mobility readon X1600
贫贱不能移,富贵不能淫,威武不能屈
acer 5595 : core2 duo T7200;2*1024M DDR2-667 ;intel 965pm;ati mobility readon X1600
贫贱不能移,富贵不能淫,威武不能屈
-
- 帖子: 10
- 注册时间: 2010-02-27 9:40
Re: time命令的问题
谢谢,这个解决了。。。
还有个问题,怎么设置得到的结果的精确度呢?默认的只有两位小数,但我要四位,请问怎么设置呢?
还有个问题,怎么设置得到的结果的精确度呢?默认的只有两位小数,但我要四位,请问怎么设置呢?