【发布时间】:2017-04-27 22:52:48
【问题描述】:
这个脚本有什么问题?
#!/bin/sh
SONAR="~/SonarQube/bin/linux-x86-64/sonar.sh"
echo "Waiting to start..."
$($SONAR start)
上面写着./start.sh: 4: ./start.sh: ~/SonarQube/bin/linux-x86-64/sonar.sh: not found,但它确实存在。我尝试了很多只适用于 eval 的变体:eval $SONAR start。
【问题讨论】:
-
我目前无法访问 bourne shell,但您可以尝试在 /bin/sh..."#!/bin/sh -x" 之后添加 -x将在执行命令之前回显命令。这可能会让您更深入地了解实际发生的情况。