Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: &&||



On 20/02/18 01:26 AM, Peter Stephenson wrote:
I think you were trying to make the status depend only on what was
before the first "&&".  You can certainly do
But isn't that exactly what I did do?  Appending to you code below:

first-statement && {
    any-old-stuff
} || {something-else-entirely}
Yet the return value of any-old-stuff (egrep in practice) was what actually controlled something-else-entirely.  I'm not expecting the pipes within any braced structure to make any difference.  Is that what's happening?  Is so, how/why?  Do not the braces pointedly force the entire structure to be subordinate to the first '&&'?  It seems to me that the left>right association in my original code is sorta 'brutally' adhered to in such a way that the natural meaning of the braces is violated such that any-old-stuff has control of branching when the natural logic is that first-statement has it.  Yes? No?


if first-statement; then
    { any-old-stuff}
else
    {something-else-entirely}
fi

That works fine egrep and/or pipes notwithstanding, yet I'm expecting both to work the same.  You seem to suggest they should as well.




Messages sorted by: Reverse Date, Date, Thread, Author