Stephane Chazelas <steph...@chazelas.org> wrote:

> 2020-02-18 11:31:54 +0100, Joerg Schilling:
> [...]
> > There is an official and documented way already, call:
> > 
> >     time -p command1 | command2
> > 
> > The time utility in POSIX requires to use the -p option to be specified.
> > Otherwise, the results are unspecified.
> > 
> > All shells I am aware detect the -p option in the parser already and switch 
> > to 
> > the time utility instead of the time keyword.
> [...]
>
> Only bash, AT&T ksh and bosh (of those shells that have a "time"
> keyword) and only when the -p is literal (not "-p",
> ${POSIXLY_CORRECT+-p}, though ksh93/bosh seem to recognise -"p"
> and -pp) and is the next word after "time".
>
> Note that AT&T ksh and bosh revert to calling the standalone
> time utility in that case so they can't be used to time
> builtin/functions.

It seems that you did not understand what I like to say:

If you like to get the previous POSIX behavior, call:

        time -p some-command

This is what POSIX did require in the past...
When you do that, you of course cannot time functions or builtins.

There however is a shell that has massive problems: "zsh".

zsh cannot time functins or builtins at all and even more:

        time -p sleep 1
        zsh: command not found: -p

as you see, the command line documentd by POSIX does not work.

Jörg

-- 
 EMail:jo...@schily.net                    (home) Jörg Schilling D-13353 Berlin
    joerg.schill...@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
 URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/'

Reply via email to