`time` crashes in a script
Bug #356624 reported by
Calil Neto
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
In a script, when I run `time` like this:
$TIME=`time $cmd`
It runs well, but when I put the time in a variable
cmd="time cmd"
$TIME=`$cmd`
It apparently crashes.
This is a testcase where it works:
$ cmd="ls"; time $cmd
(ls output)
real 0m0.003s
user 0m0.000s
sys 0m0.004s
And in this case it crashes:
$ cmd="time ls"; $cmd
(ls output)
0.00user 0.00system 0:00.00elapsed 200%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+
affects: | ubuntu → bash (Ubuntu) |
To post a comment you must log in.
ikt@ikt-desk:~$ cmd="time ls"; $cmd 305minor) pagefaults 0swaps
Dropbox Music Templates
0.00user 0.00system 0:00.00elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+
ikt@ikt-desk:~$ uname -a
Linux ikt-desk 2.6.31-14-generic #48-Ubuntu SMP Fri Oct 16 14:05:01 UTC 2009 x86_64 GNU/Linux
ikt@ikt-desk:~$
Confirming this bug in ubuntu 9.10.