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?

1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.
    – Community Bot
    Jun 2, 2022 at 8:50

1 Answer 1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .