misc/55411: One of the freebsd-tips in fortune(1) is incorrect on time(1) command.

Ceri Davies setantae at submonkey.net
Wed Aug 13 21:13:25 UTC 2003


On Wed, Aug 13, 2003 at 10:47:09PM +0200, Grzegorz Czaplinski wrote:
> On Wed, Aug 13, 2003 at 01:29:53PM -0700, Ceri Davies wrote:
> > Synopsis: One of the freebsd-tips in fortune(1) is incorrect on time(1) command.
> > 
> > State-Changed-From-To: open->closed
> > State-Changed-By: ceri
> > State-Changed-When: Wed Aug 13 13:28:53 PDT 2003
> > State-Changed-Why: 
> > The fortune is fine.
> > If it mentioned the -h switch then I'd agree, but it doesn't.
> > 
> > 
> > Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-bugs
> > Responsible-Changed-By: ceri
> > Responsible-Changed-When: Wed Aug 13 13:28:53 PDT 2003
> > Responsible-Changed-Why: 
> > Not a ports bug.
> > 
> 
> Hi there,
> 
> STOP!
> 
> I see you don't get the whole point. This is not the only one error in
> fortune tips given by Dru*.

I don't think it's an error.

The tip says:

	"To see how long it takes a command to run, type the word "time" before
		the command name."

That doesn't have anything to do with what you've mentioned below, or the -h
option, which is what your PR was about.  If that's not what your PR was about,
then you should have said so, in the PR.

> Consider that:
> 1.
> alphax# time ping -c prioris.mini.pw.edu.pl
> ping: invalid count of packets to transmit: `prioris.mini.pw.edu.pl'
> 0.000u 0.004s 0:00.04 0.0%      0+0k 1+0io 6pf+0w
> alphax# time ping -c 2 prioris.mini.pw.edu.pl
> PING prioris.mini.pw.edu.pl (194.29.178.2): 56 data bytes
> 64 bytes from 194.29.178.2: icmp_seq=0 ttl=68 time=0.874 ms
> 64 bytes from 194.29.178.2: icmp_seq=1 ttl=68 time=0.602 ms
> 
> --- prioris.mini.pw.edu.pl ping statistics ---
> 2 packets transmitted, 2 packets received, 0% packet loss
> round-trip min/avg/max/stddev = 0.602/0.738/0.874/0.136 ms
> 0.000u 0.008s 0:01.06 0.0%      0+0k 0+0io 4pf+0w

I see times here.  It tells me how many page faults there were too.

> 2.
> alphax# \time ping -c 2 prioris.mini.pw.edu.pl
> PING prioris.mini.pw.edu.pl (194.29.178.2): 56 data bytes
> 64 bytes from 194.29.178.2: icmp_seq=0 ttl=68 time=0.675 ms
> 64 bytes from 194.29.178.2: icmp_seq=1 ttl=68 time=0.630 ms
> 
> --- prioris.mini.pw.edu.pl ping statistics ---
> 2 packets transmitted, 2 packets received, 0% packet loss
> round-trip min/avg/max/stddev = 0.630/0.653/0.675/0.022 ms
>         1.02 real         0.00 user         0.00 sys

I see times here.

> 3.
> alphax# \time -h ping -c 2 prioris.mini.pw.edu.pl
> PING prioris.mini.pw.edu.pl (194.29.178.2): 56 data bytes
> 64 bytes from 194.29.178.2: icmp_seq=0 ttl=68 time=0.683 ms
> 64 bytes from 194.29.178.2: icmp_seq=1 ttl=68 time=0.507 ms
> 
> --- prioris.mini.pw.edu.pl ping statistics ---
> 2 packets transmitted, 2 packets received, 0% packet loss
> round-trip min/avg/max/stddev = 0.507/0.595/0.683/0.088 ms
>         1.01s real              0.00s user              0.00s sys

I see times here.

> These examples are from:
> alphax# uname -a
> FreeBSD alphax.mini.pw.edu.pl 5.1-RELEASE FreeBSD 5.1-RELEASE #1: Mon
> Jun 16 20:46:55 CEST 2003     root at alphax.mini.pw.edu.pl:/usr/obj/usr/src/sys/
> 
> The shell is csh. From zsh it looks much different:
> 
> alphax# time ping -c 2 prioris.mini.pw.edu.pl
> PING prioris.mini.pw.edu.pl (194.29.178.2): 56 data bytes
> 64 bytes from 194.29.178.2: icmp_seq=0 ttl=68 time=0.666 ms
> 64 bytes from 194.29.178.2: icmp_seq=1 ttl=68 time=0.642 ms
> 
> --- prioris.mini.pw.edu.pl ping statistics ---
> 2 packets transmitted, 2 packets received, 0% packet loss
> round-trip min/avg/max/stddev = 0.642/0.654/0.666/0.012 ms
> ping -c 2 prioris.mini.pw.edu.pl  0.00s user 0.01s system 0% cpu 1.012
> total

OK, so zsh's builtin time looks doesn't prefix it's output with a newline.
Your PR didn't say that either.

> If someone has csh as his/her default shell the output is totally
> unreadable. This is because you call shells builtin. Prefixing time
> command with a "\" you prevent such errors as then you call time(1).

That's a matter of opinion.  It does tell you how long the command took
to execute.

> I guess you did not perform any tests before closing the PR.

You guessed incorrectly.

Ceri
-- 
User: DO YOU ACCEPT JESUS CHRIST AS YOUR PERSONAL LORD AND SAVIOR?
Iniaes: Sure, I can accept all forms of payment.
                                           -- www.chatterboxchallenge.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-ports-bugs/attachments/20030813/0cad0581/attachment.sig>


More information about the freebsd-ports-bugs mailing list