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

pipelines and &&



I would very much like to know how sublists and pipelines are done:
I read the following without understanding how to do it:

"If two pipelines are separated by ``&&'', the second
pipeline is executed only if the first is successful (returns a zero
value).  If two pipelines are separated by ``||'', the second is
executed only if the first is unsuccessful (returns a nonzero value).
Both operators have equal precedence and are left associative."

now i try something like:
	ls | wc && | less  (just to understand the mechanism)
      
		^       ^
	There are two pipelines 1) | wc
									2) | less
	They are separated by &&.
		Result: "zsh: parse error near `|'"

I seem to do it wrong.
could you give some examples here?



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