我试图运行Casandra nodetool并从脚本得到警告。
[root@d11ca4cc-fa95-c8a9-e133-e64c434f0e6f ~]# nodetool status /opt/local/share/cassandra/bin/nodetool[53]: .[97]: [: <: unknown operator /opt/local/share/cassandra/bin/nodetool[53]: .[102]: [: <: unknown operator prtconf: devinfo facility not available /opt/local/share/cassandra/bin/nodetool[53]: .[222]: [: <: unknown operator
在第53行nodetool正在调用cassandra-env.sh。
在cassandra-env.sh(第97,102,222行)中:
... 97 if [ "$JVM_VERSION" \< "1.7" ] ; then ... if [ "$JVM_VERSION" \< "1.8" ] && [ "$JVM_PATCH_VERSION" -lt "25" ] ; then ... if { [ "$JVM_VERSION" \> "1.7" ] && [ "$JVM_VERSION" \< "1.8.0" ] && [ "$JVM_PATCH_VERSION" -ge "60" ]; } || [ "$JVM_VERSION" \> "1.8" ] ; then ...
我不知道问题出在哪里,但是在我看来,像operator \>
或\<
是不被识别的。 有什么build议吗?
我没有Solaris系统,但是看起来脚本依赖/ bin / sh作为/ bin / bash的链接,因此使用sh不能理解的bash语法。
正如您发现将shebang更改为#!/ bin / bash可以修复问题。
你应该提交一个错误报告,并希望维护者将其修复为以Linux为中心。