I'm trying to learn the bash expr command inside and out. What are some of the most basic to the most creative/tricky/unexpected ways to use the expr command? Small, manageable examples are great.
closed as not a real question by Gilles, enzotib, Michael Mrozek♦ Dec 2 '11 at 20:27
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.
I mostly used
They are functionally equivalent, but expr was slightly faster. Especially in the older days when some shells had expr as a builtin (DEC Ultrix, for example).
Also, I program in strict Bourne shell syntax, so I still use