<s>
expr	B-Application
is	O
a	O
command	B-Application
line	I-Application
utility	O
on	O
Unix	B-Application
and	O
Unix-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
which	O
evaluates	O
an	O
expression	O
and	O
outputs	O
the	O
corresponding	O
value	O
.	O
</s>
<s>
It	O
first	O
appeared	O
in	O
Unix	B-Operating_System
v7	I-Operating_System
.	O
</s>
<s>
The	O
command	B-Application
is	O
available	O
for	O
Microsoft	B-Application
Windows	I-Application
as	O
part	O
of	O
the	O
UnxUtils	B-Application
collection	O
of	O
native	B-Language
Win32	B-Library
ports	O
of	O
common	O
GNU	B-Operating_System
Unix-like	B-Operating_System
utilities	O
.	O
</s>
<s>
The	O
command	B-Application
has	O
also	O
been	O
ported	O
to	O
the	O
IBM	B-Application
i	I-Application
operating	B-General_Concept
system	I-General_Concept
.	O
</s>
<s>
expr	B-Application
evaluates	O
integer	O
or	O
string	O
expressions	O
,	O
including	O
pattern	O
matching	O
regular	B-Language
expressions	I-Language
.	O
</s>
<s>
Most	O
of	O
the	O
challenge	O
posed	O
in	O
writing	O
expressions	O
is	O
preventing	O
the	O
invoking	O
command	B-Application
line	I-Application
shell	I-Application
from	O
acting	O
on	O
characters	O
intended	O
for	O
expr	B-Application
to	O
process	O
.	O
</s>
<s>
The	O
program	O
exit	B-Operating_System
status	I-Operating_System
is	O
zero	O
for	O
this	O
example	O
.	O
</s>
<s>
For	O
pure	O
arithmetic	O
,	O
it	O
is	O
often	O
more	O
convenient	O
to	O
use	O
bc	B-Application
.	O
</s>
<s>
For	O
portable	B-Architecture
shell	O
programming	O
,	O
use	O
of	O
the	O
"	O
index	O
"	O
,	O
"	O
length	O
"	O
,	O
"	O
match	O
"	O
and	O
"	O
substr	O
"	O
commands	O
must	O
be	O
avoided	O
;	O
string	O
matching	O
remains	O
possible	O
but	O
it	O
must	O
use	O
the	O
"	O
string	O
:	O
regexp	B-Language
"	O
syntax	O
.	O
</s>
