Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Apr 2017 22:21:17 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Ernie Luzar <luzar722@gmail.com>
Cc:        FreeBSD questions <freebsd-questions@freebsd.org>
Subject:   Re: Problem with time command
Message-ID:  <20170421222117.7244970a.freebsd@edvax.de>
In-Reply-To: <58FA66D6.1040304@gmail.com>
References:  <58FA33B8.70807@gmail.com> <20170421184057.395ee6a3.freebsd@edvax.de> <58FA66D6.1040304@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 21 Apr 2017 16:08:54 -0400, Ernie Luzar wrote:
> Polytropon wrote:
> > On Fri, 21 Apr 2017 12:30:48 -0400, Ernie Luzar wrote:
> >> issuing time -h custom.refresh
> >> results in error message -h: Command not found
> >>
> >> issuing time -p custom.refresh
> >> results in error message -p: Command not found
> > 
> > I assume you're running this command interactively from within the
> > C shell, right? In this case, use /usr/bin/time to use the actual
> > "time" binary. If you don't, the C shell's built-in time command
> > will be used.
> > 
> > 
> > 
> 
> No I issued "time -h"  "time -p" from the console command line. 
> "custom.refresh" is a sh script.
> 
> I just tried "time date" from the command line and get the same results 
> as posted above.

This is to be expected. When you interactively issue the command
"time" from the C shell (which is the default interactive shell),
the shell's internal time function will be used:

% time -h true
-h: Command not found.
0.000u 0.000s 0:00.00 0.0%      0+0k 0+0io 0pf+0w

You need to explicitely specity that you wish to run the actual
time _program_, by prefixing "time" with the path:

% /usr/bin/time -h true
        0.00s real              0.00s user              0.00s sys

This will work; "man 1 time" refers to that program, _not_ to the
C shell's internal implementation.




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170421222117.7244970a.freebsd>