[Bug 1344143] [NEW] unix `time` program runs the output together when run from a Makefile

mcandre andrew.pennebaker at gmail.com
Fri Jul 18 16:31:09 UTC 2014


Public bug reported:

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?

** Affects: time (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: format make shell time tty unix

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to time in Ubuntu.
https://bugs.launchpad.net/bugs/1344143

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

Status in “time” package in Ubuntu:
  New

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 manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/time/+bug/1344143/+subscriptions



More information about the foundations-bugs mailing list