unix `time` program runs the output together when run from a Makefile
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
time (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
With default settings, the Unix `time` program runs output together in an ugly, unreadable way, when run from a Makefile.
Trace:
$ time echo '42'
42
real 0m0.000s
user 0m0.000s
sys 0m0.000s
$ cat Makefile
all:
time echo '42'
$ make
time echo '42'
42
0.00user 0.00system 0:00.00elapsed 0%CPU (0avgtext+0avgdata 628maxresident)k
0inputs+0outputs (0major+
To workaround this issue, I can force `time` to use a better format, by running it with the "-p" flag.
$ cat Makefile
all:
time -p echo '42'
$ make
time -p echo '42'
42
real 0.00
user 0.00
sys 0.00
But I would prefer not to have to do this. Could we please have `time` detect the tty status and default to "-p" more appropriately?