From: Akim Demaille <[EMAIL PROTECTED]>
   Date: 24 May 2000 10:41:53 +0200

   Akim>    expr has a bad reputation

   Paul> Its syntax is awkward -- was that what you were thinking about?

   Nope, I was referring to the portability.  And precisely about the
   syntax, is `match string expr' portable?

No.  A portable shell script cannot pass the four words "match",
"length", "substr", or "index" to expr.  For example, "expr match :
match" is not allowed.  This is another good reason to prefix the
operands of : with X.

   Paul> if expr "x$ac_package" : '.*[^-a-zA-Z0-9_]' >/dev/null; then

   My understanding of the `x' here is to avoid problems with $ac_package
   being a built-in of expr, right?

Yes.  It's not just the four words mentioned above; it's also
operators like '-' or ':'.

Reply via email to