我的脚本包含以下代码:
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
答案 0 :(得分:1)
这一行是问题
`$bin_dir/neo4j stop`
neo4j停止,但由于反引号,你执行neo4j stop
的输出作为命令。
删除那些反引号。