Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
"{ } always { }" construct and return in called functions
- X-seq: zsh-users 20202
- From: ia0 <zsh@xxxxxx>
- To: zsh-users@xxxxxxx
- Subject: "{ } always { }" construct and return in called functions
- Date: Wed, 13 May 2015 14:31:41 +0200
- 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
Hello everyone,
There is something I don't understand with the "{ } always { }" construct.
What is the difference between the two following runs? I would expect the
last run to behave as the first one. What am I missing here?
*% zsh --version*
zsh 5.0.2 (x86_64-pc-linux-gnu)
*% cat test*
#!/bin/zsh
mytrue() { return 0 }
mywrap() { echo BEGIN; $1; echo END }
mytest() { { exit 1 } always { mywrap $1 } }
mytest $1
*% ./test true*
BEGIN
END
*1% ./test mytrue*
BEGIN
*1% *
Since I don't know if I successfully subscribed to the mailing list, please
Cc me to your answer.
Thanks,
ia0
Messages sorted by:
Reverse Date,
Date,
Thread,
Author