Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Intercepting commands before they're run
- X-seq: zsh-users 3021
- From: Oliver Kiddle <opk@xxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxxxxxx
- Subject: Intercepting commands before they're run
- Date: Thu, 13 Apr 2000 12:57:43 +0100
- Mailing-list: contact zsh-users-help@xxxxxxxxxxxxxx; run by ezmlm
I've just been experimenting with the MH mail system to see if it will
do what I hope. In mush I can just type a message number to see a
message so I tried to think of a way to persuade zsh to do this.
The best I can do is:
preexec() {
[[ $1 = <-> ]] && show $1
}
This works but zsh still tries to run the command so I always get
something like:
zsh: command not found: 3
Is there a way round this? If not, maybe we should let preexec return an
exit code to say the command should not be run - there may be other
uses. There might also be uses for preexec to be able to make changes to
the command-line before it is run.
Oliver Kiddle
Messages sorted by:
Reverse Date,
Date,
Thread,
Author