Bug#511456: time: defaults to POSIX non-compliance
Bart Massey wrote: > Thanks! I agree that this is much better. Forwarded to bug-gnu-utils. Hopefully someone there will take pity on us and become GNU time maintainer. :) -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#511456: time: defaults to POSIX non-compliance
Thanks! I agree that this is much better. Only thing better yet would be to fix the POSIX standard to require that format by default, and I can't see that happening anytime soon. :-) Thanks much for working on this. Bart On Mon, Feb 7, 2011 at 6:02 PM, Jonathan Nieder wrote: > tags 511456 - moreinfo > retitle 511456 time: documentation of -p is unclear > severity 511456 minor > tags 511456 + upstream > quit > > Bart Massey wrote: > >> Sorry, I hadn' t realized the POSIX standard was so broken that it >> required a flag to get a guarantee of predictable formatting. I guess >> under those circumstances I'll just have to get used to writing "time >> -p" and hoping that everyone's "time" implementation is >> POSIX-compliant. > > Ok, cc-ing the bug log. Now that I check the manpage and info > documentation, I can agree that it is downright misleading: > > -p, --portability > Use the following format string, for conformance with > POSIX standard 1003.2: > > real %e > user %U > sys %S > > It would be better to say: > > -p, --portability > Use the following format string: > > real %e > user %U > sys %S > > The default output format of time differs widely > between implementations. This option (in its > short form -p) is supported by all POSIX-compliant > 'time' implementations to retrieve basic > information in the described format. > > Roughly like this, maybe. > --- > diff --git a/time.texi b/time.texi > index c725f8a..8da3727 100644 > --- a/time.texi > +++ b/time.texi > @@ -182,8 +182,7 @@ Use @var{format} as the format string. > > @item -p > @itemx --portability > -Use the following format string, for conformance with POSIX standard > -1003.2: > +Use the following format string: > > @example > real %e > @@ -191,6 +190,11 @@ user %U > sys %S > @end example > > +The default output format of time differs widely between > +implementations. This option (in its short form -p) is supported by all > +POSIX-compliant 'time' implementations to retrieve basic information in > +the described format. > + > @item -q > @itemx --quiet > Suppress non-zero error code from the executed program. > -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#511456: time: defaults to POSIX non-compliance
tags 511456 - moreinfo retitle 511456 time: documentation of -p is unclear severity 511456 minor tags 511456 + upstream quit Bart Massey wrote: > Sorry, I hadn' t realized the POSIX standard was so broken that it > required a flag to get a guarantee of predictable formatting. I guess > under those circumstances I'll just have to get used to writing "time > -p" and hoping that everyone's "time" implementation is > POSIX-compliant. Ok, cc-ing the bug log. Now that I check the manpage and info documentation, I can agree that it is downright misleading: -p, --portability Use the following format string, for conformance with POSIX standard 1003.2: real %e user %U sys %S It would be better to say: -p, --portability Use the following format string: real %e user %U sys %S The default output format of time differs widely between implementations. This option (in its short form -p) is supported by all POSIX-compliant 'time' implementations to retrieve basic information in the described format. Roughly like this, maybe. --- diff --git a/time.texi b/time.texi index c725f8a..8da3727 100644 --- a/time.texi +++ b/time.texi @@ -182,8 +182,7 @@ Use @var{format} as the format string. @item -p @itemx --portability -Use the following format string, for conformance with POSIX standard -1003.2: +Use the following format string: @example real %e @@ -191,6 +190,11 @@ user %U sys %S @end example +The default output format of time differs widely between +implementations. This option (in its short form -p) is supported by all +POSIX-compliant 'time' implementations to retrieve basic information in +the described format. + @item -q @itemx --quiet Suppress non-zero error code from the executed program. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#511456: time: defaults to POSIX non-compliance
Hi Bart, Two years ago, you wrote[1]: > GNU "time" has a --portability flag to get the > POSIX-mandated formatting of its output. The BASH "time" > builtin is used in /bin/sh invocations and is > POSIX-compliant. The combination of these features means > that it is difficult to write portable shell scripts that > examine the output of "time" but work under Debian. A > workaround is [...] I responded by mentioning that the output format is not mandated by POSIX but with the -p option[2] it is. Does that address your concern? Perhaps some documentation was confusing and should be clarified? Thanks for your work to improve Debian, Jonathan [1] http://bugs.debian.org/511456 [2] http://www.opengroup.org/onlinepubs/9699919799/utilities/time.html#tag_20_129_04 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#511456: time: defaults to POSIX non-compliance
severity 511456 wishlist tags 511456 + moreinfo quit Hi Bart, Sorry for the long silence. Bart Massey wrote: > GNU "time" has a --portability flag to get the > POSIX-mandated formatting of its output. The BASH "time" > builtin is used in /bin/sh invocations and is > POSIX-compliant. The combination of these features means > that it is difficult to write portable shell scripts that > examine the output of "time" but work under Debian. Why can't you use "time -p" unconditionally? POSIX has this to say[1]: -p Write the timing output to standard error in the format shown in the STDERR section. so I think it should be reliable. [1] http://www.opengroup.org/onlinepubs/9699919799/utilities/time.html#tag_20_129_04 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Bug#511456: time: defaults to POSIX non-compliance
Package: time Version: 1.7-23 Severity: normal GNU "time" has a --portability flag to get the POSIX-mandated formatting of its output. The BASH "time" builtin is used in /bin/sh invocations and is POSIX-compliant. The combination of these features means that it is difficult to write portable shell scripts that examine the output of "time" but work under Debian. A workaround is to set the TIME environment variable to the POSIX format, but since other programs may use an environment variable named something as generic as "TIME" in other ways, one must be fairly selective about it; in any case, it's a gratuitous painful wart. The default behavior of "time" should be POSIX-compliant. A flag and/or environment variable could instead give the current non-standard behavior. -- System Information: Debian Release: lenny/sid APT prefers testing APT policy: (990, 'testing'), (150, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.6.24-1-686 (SMP w/1 CPU core) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages time depends on: ii libc6 2.7-16 GNU C Library: Shared libraries time recommends no packages. time suggests no packages. -- no debconf information -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org