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

Re: &&||

On 19/02/18 01:57 PM, Peter Stephenson wrote:
You never need to use output from ls in a shell
Yeah, I was just trying to make a fast list of something to filter. Mind, I do tend to forget about zsh's internal power when it comes to that sort of thing so the reminder is welcome.

Do you mean just "true"? Not sure what putting this in square brackets

Right, 'true' and 'false' live without any syntactic wrapping.  I forgot.

is supposed to achieve.  It does work, but purely by virtue of the fact

You can affect the precedence with braces, but they need to surround the
"&&" or "||" expression you want to protect.  In your case you've simply
surrounded a pipeline which would be run in one go anyway:
That's my question, could my code be made to work more or less as it is?  I was expecting the braces to work.  Otherwise I fairly well understand the basic rules esp. the left>right thing, it really does make life a bit simpler.  Mind, I suppose that since return values are always suspect perhaps an if/else construction really is just better.

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