由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - A question about command time
相关主题
how to run background process after logout急,定时运行程序的问题
perl Qhow to redirect the output
how to get rid of the ^M in files?UNIX dummy Questions?
双面打印Re: [转载] how to get the return value of a command by shell?
how to redirect error output under unixRe: How to setup the arrowkey(for history command) and table-complete
请教How to get rid of the bg job id redirection?AIX shell configuration
how to grep with more than one patterns in tcsh?Command history
够执着的 --- Re: 我的alia放在script里为什么不工作?how to make Del work under tcsh/csh?
相关话题的讨论汇总
话题: command话题: time话题: file话题: format话题: output
进入Unix版参与讨论
1 (共1页)
T***B
发帖数: 137
1
I need to track the time run for a program and save the data to a file. I
tried the following command:
time ./a.out > output
0.000u 0.010s 0:00.01 100.0% 0+0k 0+0io 132pf+0w
But the data about timing was still printed on the screen, not to the file.
Can anyone help? Thanks.
BTW, I run the command under linux.
o***z
发帖数: 133
2
-o option?
man time

【在 T***B 的大作中提到】
: I need to track the time run for a program and save the data to a file. I
: tried the following command:
: time ./a.out > output
: 0.000u 0.010s 0:00.01 100.0% 0+0k 0+0io 132pf+0w
: But the data about timing was still printed on the screen, not to the file.
: Can anyone help? Thanks.
: BTW, I run the command under linux.

T***B
发帖数: 137
3
Thanks, ottoz.
There is a -o option in the man time file. But it doesn't work in my
environment (bad command). It seems that -o is a GNU option. Is this the cause
of the problem? Is that a way to handle it?
GNU OPTIONS
-f FORMAT, --format=FORMAT
Specify output format, possibly overriding the for-
mat specified in the environment variable TIME.
-p, --portability
Use the portable output format.
-o FILE, --output=FILE
Do

【在 o***z 的大作中提到】
: -o option?
: man time

o***z
发帖数: 133
4
what's your shell
and what did you type as the command?

【在 T***B 的大作中提到】
: Thanks, ottoz.
: There is a -o option in the man time file. But it doesn't work in my
: environment (bad command). It seems that -o is a GNU option. Is this the cause
: of the problem? Is that a way to handle it?
: GNU OPTIONS
: -f FORMAT, --format=FORMAT
: Specify output format, possibly overriding the for-
: mat specified in the environment variable TIME.
: -p, --portability
: Use the portable output format.

o***z
发帖数: 133
5
there's a built-in time command in tcsh
did you try
/usr/bin/time -V

【在 T***B 的大作中提到】
: Thanks, ottoz.
: There is a -o option in the man time file. But it doesn't work in my
: environment (bad command). It seems that -o is a GNU option. Is this the cause
: of the problem? Is that a way to handle it?
: GNU OPTIONS
: -f FORMAT, --format=FORMAT
: Specify output format, possibly overriding the for-
: mat specified in the environment variable TIME.
: -p, --portability
: Use the portable output format.

T***B
发帖数: 137
6
Thanks. My shell is tcsh.
And the following command works:
/usr/bin/time -o tracktime ./a.out > output

cause

【在 o***z 的大作中提到】
: there's a built-in time command in tcsh
: did you try
: /usr/bin/time -V

1 (共1页)
进入Unix版参与讨论
相关主题
how to make Del work under tcsh/csh?how to redirect error output under unix
how to let awk not print?请教How to get rid of the bg job id redirection?
怎么用了./a.out还是Command not found啊?how to grep with more than one patterns in tcsh?
how do I check my GNU make version?够执着的 --- Re: 我的alia放在script里为什么不工作?
how to run background process after logout急,定时运行程序的问题
perl Qhow to redirect the output
how to get rid of the ^M in files?UNIX dummy Questions?
双面打印Re: [转载] how to get the return value of a command by shell?
相关话题的讨论汇总
话题: command话题: time话题: file话题: format话题: output