我正在尝试使用使用 jline 库的 apache karaf 命令行有条件地执行命令。
我在 shell:if 命令上找不到任何文档。
例如,在 linux shell 中这是有效的:
if [ "foo" = "foo" ]; then echo "good"; fi
当我将 karaf 的语法更改为:
if [ "foo" = "foo" ] echo "good"
我得到错误:
Error executing command shell:if: unable to convert argument condition with value '{foo=foo}' to type org.apache.felix.service.command.Function
我尝试了一堆不同的语法,但我无法弄清楚。