https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203279

            Bug ID: 203279
           Summary: /bin/expr operator : fails when the string has a
                    leading hyphen.
           Product: Base System
           Version: 10.2-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: [email protected]
          Reporter: [email protected]

expr on other *NIX versions seems to handle a leading hyphen in the text
string.
On FreeBSD, the hyphen is parsed as an illegal option:

/bin/expr '-XXabs' : '.*\(aa*\)'
expr: illegal option -- X
expr: usage: expr [-e] expression

A trivial workaround is to use grouping:

/bin/expr \( '-XXabs' : '.*\(aa*\)' \)
a

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to