unix `time` program runs the output together when run from a Makefile

Bug #1344143 reported by mcandre
6
This bug affects 1 person
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+206minor)pagefaults 0swaps

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?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.