Problem with time command
Ernie Luzar
luzar722 at gmail.com
Fri Apr 21 20:08:51 UTC 2017
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.
>
>
>
More information about the freebsd-questions
mailing list