Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Re: Bug: time doesn't work on builtins
- X-seq: zsh-workers 53096
- From: Oliver Kiddle <opk@xxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: PATCH: Re: Bug: time doesn't work on builtins
- Date: Fri, 20 Sep 2024 09:46:04 +0200
- Archived-at: <https://zsh.org/workers/53096>
- In-reply-to: <CAH+w=7aoR9Tqj7eZWp3OXicyaZO4v2fF2ymBBr8yFVBr1sit6w@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAA=-s3w0wsH7xkS58JS0AbGdOoihYxq+cKEpVomFU_f1_w-ynQ@mail.gmail.com> <CAH+w=7a3BuQnPMa5YEy8n8ZNSNNoYNKLL9Aki5iCSPKbTyn5eQ@mail.gmail.com> <CAA=-s3z3YMho0a4A3H4h3o75oY1fR36w2zz83zQKjyPi3mSTpQ@mail.gmail.com> <CAH+w=7ZZ3frU9OjpkOmHzvL6Ws0YQPE=_JK+izmRR+gEcvSsDg@mail.gmail.com> <CAH+w=7ZpU-QCFAfPYvBFQvUnfekV35c3B_j7eoWvo8MokJ0Ncw@mail.gmail.com> <20C9A9EE-49A5-4A58-AA00-136A5D221331@kba.biglobe.ne.jp> <CAH+w=7aKEm0t37Df9kS0KEYXrp607zX+1cV3xtAJ9bbjfXgXsw@mail.gmail.com> <CEAB70F9-A50B-4A2E-90B8-A8017E921EA7@kba.biglobe.ne.jp> <CAH+w=7bef-8TgpNJJ3fsb-reMjQb5iN58qRMfq+QmfU0HmWtXw@mail.gmail.com> <CAH+w=7aoR9Tqj7eZWp3OXicyaZO4v2fF2ymBBr8yFVBr1sit6w@mail.gmail.com>
On 13 Sep, Bart Schaefer wrote:
> + ( setopt errexit; time =false; print notreached )
> +1:`time' of failed external with errexit
> +*?*user*system*cpu*total
This test fails on Solaris because the external false returns -1 instead
of 1.
Two alternatives that come to mind would be test which returns false if
given no arguments and expr 0 which has the advantage of not existing as
a builtin so no need for the =. Both of those return 1 on Solaris for
failure.
Oliver
Messages sorted by:
Reverse Date,
Date,
Thread,
Author