Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Bug with trap?
- X-seq: zsh-users 15036
- From: Omari Norman <omari@xxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxx
- Subject: Bug with trap?
- Date: Fri, 30 Apr 2010 18:38:57 -0400
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
It seems that the trap builtin with the EXIT argument does not work
properly if you have a list inside curly braces and the output is piped
to another command. For example:
~ % zsh <<EOF
trap "echo exit trap running" EXIT
EOF
exit trap running
~ % zsh <<EOF
{ trap "echo exit trap running" EXIT}
EOF
exit trap running
~ % zsh <<EOF
{ trap "echo exit trap running" EXIT} | cat
EOF
~ %
Thus the trap in the last example simply did not run. You can try this
with another command in the trap (e.g. touch, or rm) and you will get
the same result: the trap does not run.
This is zsh 4.3.6 on Debian 5.0. Is this a bug or am I missing
something?
Thanks.
Omari
Messages sorted by:
Reverse Date,
Date,
Thread,
Author