Марк Коренберг wrote: > Configuration Information [Automatically generated, do not change]: > Machine: i486 > OS: linux-gnu > Compiler: gcc > Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486' > -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu' > -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' > -DSHELL -DHAVE_CONFIG_H -I. -I../bash -I../bash/include > -I../bash/lib -g -O2 -Wall > uname output: Linux mmarkk-desktop 2.6.27-11-generic #1 SMP Thu Jan 29 > 19:24:39 UTC 2009 i686 GNU/Linux > Machine Type: i486-pc-linux-gnu > > Bash Version: 3.2 > Patch Level: 39 > Release Status: release > > Description: > TIMEFORMAT variable improperly handled > > Repeat-By: > $ TIMEFORMAT='test'; time echo aaa > aaa > test > (works OK, but:) > > $ TIMEFORMAT='test' time echo aaa > outputs something like this: > aaa > 0.00user 0.00system 0:00.00elapsed 200%CPU (0avgtext+0avgdata > 0maxresident)k > 0inputs+0outputs (0major+198minor)pagefaults 0swaps > ( it seems memory leak or undocumented features of the bash...) > > BASH 2.05 said: > $ TIMEFORMAT=1 time echo q > -bash: time: command not found
`time' is a bash reserved word. It's essentially a pipeline modifier that allows pipelines, shell builtins, shell functions, and shell programming constructs to be timed. The bash built-in command timing is what understands and interprets $TIMEFORMAT. Preceding a reserved word with an assignment statement prevents it from being recognized as such. When you use the assignment statement, you end up running /usr/bin/time, which does not interpret $TIMEFORMAT and has a different output format. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/