1

On OSX I'd like these to be the same (preferably the first format). How do I do it without post-processing?

$ time echo foo
foo

real    0m0.000s
user    0m0.000s
sys 0m0.000s
$ echo | time echo foo
foo
        0.00 real         0.00 user         0.00 sys
1

Use the -p option: "The output is formatted as specified by IEEE Std 1003.2-1992 ('POSIX.2')." This isn't perfect (there seems to be some tab/space weirdness going on), but the times themselves will be formatted the same:

$ time -p echo foo
foo
real 0.00
user 0.00
sys 0.00

$ echo | time -p echo foo
foo
real         0.00
user         0.00
sys          0.00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.