> From: zangwenkuo > > To: bug-bash@gnu.org > when i use the fun as title (expr) > i got a "expr: syntax error" > > expr is an external tool, and expr is the one giving you an error, so it's not a problem of "bash" The error may be that your "expr" tool is not the gnu version and thus doesn't support this syntax.
To get the same result you could use the pattern matching of standard expr eg matching all the characters not in your set + one: ind=`expr "$string" : '[^is]*.'` with pure (ba)sh, you could use parameter expansion like: temp=${string%%[is]*} ind=$(( ${#temp} + 1))