我的脚本包含以下代码:
bin_dir="/export/neo4j-community-2.0.0-M06/bin"
...snip...
`$bin_dir/neo4j stop`
stoprc=$?
if [ "${stoprc}" -ne "0" ] ; then
echo "Error stopping neo4j. Please check that it is running."
exit ${stoprc}
fi
结果是
Stopping: not found [No such file or directory]
Return code is 127
这是此脚本的 ksh -x 的输出。
+ /export/neo4j-community-2.0.0-M06/bin/neo4j stop
+ Stopping Neo4j Server '[13634]....' done
restore_graph.ksh[42]: Stopping: not found [No such file or directory]
+ stoprc=127
但是当我从命令行运行 ="/export/neo4j-community-2.0.0-M06/bin/neo4j stop" 时,我没有任何问题:
: /export/neo4j-community-2.0.0-M06/bin/neo4j stop
Stopping Neo4j Server [12975].... done
: echo $?
0