Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

zsh "always", manpage error?

0 views
Skip to first unread message

Enrique Perez-Terron

unread,
Nov 27, 2005, 10:40:13 AM11/27/05
to
Hello,
I have just started looking at zsh, and I see in zshmisc(1):

{ try-list } always { always-list }
... execute always-list.
Execution then continues from the result of the execution of
try-list; in other words, any error, or break, continue, or
return command is treated in the normal way, as if always-list
were not present.

...

Regardless of TRY_BLOCK_ERROR, after the end of always-list
the normal shell status $? is the value returned from always-list.
This will be non-zero if there was an error, even if
TRY_BLOCK_ERROR was set to zero.

This sounds like a contradiction.


% { false } always { true }; echo $?
1

This seems to conform to the first paragraph above, and contradicts
the second. After the end of the always-list the normal shell status
$? is 1 as returned from try-list, not the value returned from
always-list.

% { true } always { false }; echo $?
0

The same. Am I missing something?

-Enrique

Bill Marcum

unread,
Nov 27, 2005, 1:44:15 PM11/27/05
to
On Sun, 27 Nov 2005 16:40:13 +0100, Enrique Perez-Terron
<en...@online.no> wrote:

empty message, posting error?

--
"Buy land. They've stopped making it."
-- Mark Twain

Enrique Perez-Terron

unread,
Nov 28, 2005, 12:38:13 PM11/28/05
to
On Sun, 27 Nov 2005 19:44:15 +0100, Bill Marcum <bma...@iglou.com> wrote:

> On Sun, 27 Nov 2005 16:40:13 +0100, Enrique Perez-Terron
> <en...@online.no> wrote:
>
> empty message, posting error?

You'll have to reload the message. It was reflected with contents from my news
server, and I also find it with contents on google:

http://groups.google.com/group/comp.unix.shell/browse_frm/thread/2e2c29bfa1f27234/24860326fbb52d2b#24860326fbb52d2b

-Enrique

0 new messages