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

next in thread | previous in thread | raw e-mail | index | archive | help
Polytropon wrote:
> On Fri, 21 Apr 2017 12:30:48 -0400, Ernie Luzar wrote:
>> Hello list;
>>
>> Was testing the time command. These problems came to light.
>>
>>
>> time [-al] [-h | -p ] utility-name
> 
> That somehow doesn't look like "man 1 time". The synopsis
> should be:
> 
> SYNOPSIS
>      time [-al] [-h | -p] [-o file] utility [argument ...]
> 
>

Ok yes I shorten it for the post

>> 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.


>> The DESCRIPTION says,
>> The time utility executes and times the specified utility. After the 
>> utility finishes, time writes to the standard error stream, (in 
>> seconds): the total time elapsed, the time used to execute the utility 
>> process and the time consumed by system overhead.
>>
>> issuing time custom.refresh
>> results in this output
>> 0.089u 0.469s 0:01.44 37.5%     32+181k 64+137io 709pf+0w
> 
> That proves you're using the C shell's internal time command, not
> the binary. It would have an output format like this:
> 
> % /usr/bin/time ls
>         0.00s real              0.00s user              0.00s sys
> 
> When you use the "time" command _inside_ your script, the binary
> will be used because sh (the script's interpreter) doesn't have
> a built-in time command.
> 
> 
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?58FA66D6.1040304>