Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Apr 2017 18:40:57 +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:  <20170421184057.395ee6a3.freebsd@edvax.de>
In-Reply-To: <58FA33B8.70807@gmail.com>
References:  <58FA33B8.70807@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 ...]


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



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



-- 
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?20170421184057.395ee6a3.freebsd>