From aaron@meta.lo-res.org  Mon Apr  8 05:47:47 2002
Return-Path: <aaron@meta.lo-res.org>
Received: from meta.lo-res.org (meta.lo-res.org [195.58.189.92])
	by hub.freebsd.org (Postfix) with ESMTP id 10FCB37B417
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  8 Apr 2002 05:47:46 -0700 (PDT)
Received: from meta.lo-res.org (knwluz@localhost [127.0.0.1])
	by meta.lo-res.org (8.12.2/8.12.2) with ESMTP id g38CliRe009812
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 8 Apr 2002 14:47:44 +0200 (CEST)
	(envelope-from aaron@meta.lo-res.org)
Received: (from aaron@localhost)
	by meta.lo-res.org (8.12.2/8.12.2/Submit) id g38CkTDR009784;
	Mon, 8 Apr 2002 14:46:29 +0200 (CEST)
Message-Id: <200204081246.g38CkTDR009784@meta.lo-res.org>
Date: Mon, 8 Apr 2002 14:46:29 +0200 (CEST)
From: aaron <aaron@lo-res.org>
Reply-To: aaron <aaron@lo-res.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: time(1): invalid arguments
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         36874
>Category:       bin
>Synopsis:       time(1): invalid arguments
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 08 05:50:01 PDT 2002
>Closed-Date:    Mon Apr 08 23:45:32 PDT 2002
>Last-Modified:  Mon Apr 08 23:45:32 PDT 2002
>Originator:     aaron
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
>Environment:
System: FreeBSD meta.lo-res.org 4.5-STABLE FreeBSD 4.5-STABLE #10: Sat Apr 6 20:21:43 CEST 2002 root@meta.lo-res.org:/usr/people/scratch/usr/people/src/sys/meta i386


	
>Description:
	as mentioned in the man pages, time(1) should accept some
	flags such as "-l", "-p"

	But it complains (tries to execute the flags) when f.ex "-l" is
	given.

>How-To-Repeat:

aaron@meta:~> time -l ls
bash: -l: command not found
      ^^^^^^^^^^^^^^ ---- oops!
real    0m0.004s
user    0m0.001s
sys     0m0.002s


HOWEVER: when you type in in:
/usr/bin/time -l ls

everything works as expected.


>Fix:

I personally assume something is wrong in the argv calculation at line
111 of /usr/src/usr.bin/time/time.c or maybe in execvp (child) which would
be really strange.




>Release-Note:
>Audit-Trail:

From: aaron <aaron@lo-res.org>
To: freebsd-gnats-submit@FreeBSD.org, aaron@lo-res.org
Cc:  
Subject: Re: bin/36874: time(1): invalid arguments
Date: Mon, 8 Apr 2002 14:56:59 +0200

 Sorry, my mistake: 
 
 man builtin ... search for "time". Of course the builtin "time" command took 
 precedence and apparently this one does not understand the "-l" option.
 
 Is there a chance to fix the builtin(1) "time" command?
 

From: Edwin Groothuis <edwin@mavetju.org>
To: aaron <aaron@lo-res.org>
Cc: FreeBSD-gnats-submit@FreeBSD.org
Subject: Re: bin/36874: time(1): invalid arguments
Date: Mon, 8 Apr 2002 22:57:15 +1000

 On Mon, Apr 08, 2002 at 02:46:29PM +0200, aaron wrote:
 > >Description:
 > 	as mentioned in the man pages, time(1) should accept some
 > 	flags such as "-l", "-p"
 > 
 > 	But it complains (tries to execute the flags) when f.ex "-l" is
 > 	given.
 > 
 > >How-To-Repeat:
 > 
 > aaron@meta:~> time -l ls
 > bash: -l: command not found
 >       ^^^^^^^^^^^^^^ ---- oops!
 > real    0m0.004s
 > user    0m0.001s
 > sys     0m0.002s
 > 
 > 
 > HOWEVER: when you type in in:
 > /usr/bin/time -l ls
 > 
 > everything works as expected.
 
 time (without the path) is the one which is implemented in your shell.
 /usr/bin/time (with the path) is the one which is coming with the system.
 
 If you're using bash, see "man bash" and search for time.
 
 Edwin
 
 -- 
 Edwin Groothuis   |              Personal website: http://www.MavEtJu.org
 edwin@mavetju.org |           Interested in MUDs? Visit Fatal Dimensions:
 ------------------+                       http://www.FatalDimensions.org/

From: Bruce Evans <bde@zeta.org.au>
To: Edwin Groothuis <edwin@mavetju.org>
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: bin/36874: time(1): invalid arguments
Date: Mon, 8 Apr 2002 23:17:03 +1000 (EST)

 On Mon, 8 Apr 2002, Edwin Groothuis wrote:
 
 >  On Mon, Apr 08, 2002 at 02:46:29PM +0200, aaron wrote:
 >  > >Description:
 >  > ...
 >  > aaron@meta:~> time -l ls
 >  > bash: -l: command not found
 >  >       ^^^^^^^^^^^^^^ ---- oops!
 >  > real    0m0.004s
 >  > user    0m0.001s
 >  > sys     0m0.002s
 >  >
 >  >
 >  > HOWEVER: when you type in in:
 >  > /usr/bin/time -l ls
 >  >
 >  > everything works as expected.
 >
 >  time (without the path) is the one which is implemented in your shell.
 >  /usr/bin/time (with the path) is the one which is coming with the system.
 >
 >  If you're using bash, see "man bash" and search for time.
 
 I couldn't even find a way to tell bash-2 to stop using its broken time(!1).
 `time' in bash-2 is a keyword, not a builtin, so I couldn't find a way to
 override it using aliases or shell functions .  My solution for this was
 to upgrade to bash-1 :-), but i still notice the brokenness when I
 run something like "time tar cf foo bar" ... ^Z.  The broken time prints
 its values when the process is suspended and doesn't print anything when
 the process completes.
 
 Bruce
 
State-Changed-From-To: open->closed 
State-Changed-By: cjc 
State-Changed-When: Mon Apr 8 23:44:14 PDT 2002 
State-Changed-Why:  
Not a time(1) bug. As has been pointed out, the shell builtin was 
being used. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=36874 
>Unformatted:
