expr states in its info page:
Exit status:
0 if the expression is neither null nor 0,
1 if the expression is null or 0,
2 for invalid expressions.
However shellutils 2.0-3 contains in the changelog
shellutils (2.0-3) unstable; urgency=low
* New maintainer
* Fixed date-examples in infopages, Closes: Bug# 32130
* expr.c: don't return with an errorcode if the result is 0
Closes: Bug# 50697
-- Wichert Akkerman <wakkerma@debian.org> Sun, 21 Nov 1999 01:34:07 +0100
After the change, the return value of expr can't be used anymore in
constructions like
expr match string expression
or
expr index needle haystack
A "lot" of shellscripts will break and *do* break. Most prominent example
is MAKEFLOPPIES. Please resolve this issue and revert the change.
expr should probably return 0 if the result is zero only on arithmetical
expressions. What do the standards say?
Nils
--
Plug-and-Play is really nice, unfortunately it only works 50% of the time.
To be specific the "Plug" almost always works. --unknown source
Attachment:
pgpSyjrThMh5o.pgp
Description: PGP signature