Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: time command with shell builtins
- X-seq: zsh-users 28775
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: dominik.vogt@xxxxxx, zsh-users@xxxxxxx
- Subject: Re: time command with shell builtins
- Date: Tue, 24 Jan 2023 15:36:51 -0800
- Archived-at: <https://zsh.org/users/28775>
- In-reply-to: <Y9BlzD/hb4bwHAmb@localhost>
- List-id: <zsh-users.zsh.org>
- References: <Y86OR0DCpwfSYCXU@localhost> <CAN=4vMqSxEr-K1xg+fGc9kh2qfiZ31fy7hoDBRNHXXF6pH8eEg@mail.gmail.com> <Y86ZkYooJ9Kf4xCE@localhost> <CAHYJk3QD8NbCqt0LdXshiVf6W3GQLnDzo6-1mj0qCJOTkHFGRA@mail.gmail.com> <Y87Ws8PrZY8W3Oao@localhost> <CAHYJk3Tu5POCU08-g1dr2p284p89Xak5XjLSV6J8gWdQnOXDeA@mail.gmail.com> <Y8+3h5OXqtpkyewM@localhost> <Y9BlzD/hb4bwHAmb@localhost>
On Tue, Jan 24, 2023 at 3:14 PM Dominik Vogt <dominik.vogt@xxxxxx> wrote:
>
> As far as I understand there's no reliable access to
> which command is being executed in preexec.
There's reliable access to what the user typed and to what that
expands to after alias replacement. What else would you be looking
for?
preexec
Executed just after a command has been read and is about to be
executed. If the history mechanism is active (regardless of
whether the line was discarded from the history buffer), the string
that the user typed is passed as the first argument, otherwise it
is an empty string. The actual command that will be executed
(including expanded aliases) is passed in two different forms: the
second argument is a single-line, size-limited version of the
command (with things like function bodies elided); the third
argument contains the full text that is being executed.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author