0

I search man expr and found expression 1 | expression 2 to reutnr expression 1 if it is neither an empty string nor zero; otherwise, returns evaluation of expression 2 if it is not an empty string.

Isnt pipe suppose to pass expression 1 into expression 2?

Are these 2 pipes different?

  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Jun 02 '22 at 08:50

1 Answers1

1

They are different.

Note man expr also states:

Beware that many operators need to be escaped or quoted for shells.

The | used by expr is not a pipe and must be typed either within quotation marks or escaped as \| to prevent bash from treating it as one.