jruby.sh causes "unportable BRE" warning on CentOS (but works fine)
-------------------------------------------------------------------
Key: JRUBY-3695
URL: http://jira.codehaus.org/browse/JRUBY-3695
Project: JRuby
Issue Type: Bug
Affects Versions: JRuby 1.2
Environment: CentOS 5.3
Reporter: Menno Jonkers
Assignee: Thomas E Enebo
Priority: Trivial
When starting bin/jruby (aka jruby.sh) on CentOS, this warning is issued:
expr: warning: unportable BRE: `^/': using `^' as the first character
of the basic regular expression is not portable; it is being ignored
It is caused by the regexp '^/' at line 41:
if expr "$link" : '^/' > /dev/null; then
Apparently [1] according to POSIX standards the : operator always anchors the
patterns to the beginning of the string. The semantics of a ^ at the start are
unspecified:
"all patterns are anchored to the beginning of the string (that is, only
sequences starting at the first character of a string are matched by the
regular expression) and, therefore, it is unspecified whether '^' is a special
character in that context. "
This suggest that the ^ can be removed, which indeed seems to work fine on
CentoOS and Ubuntu:
if expr "$link" : '/' > /dev/null; then
[1] See section "Matching Expression" at
http://www.opengroup.org/onlinepubs/009695399/utilities/expr.html
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email