将&移至行尾
#!/bin/sh# this script starts a jar file and creates a shellscript which can be used to stop the execution.nohup java -jar ~/storagenode.jar > ~/storagenode.log &pId=$!echo "kill $pId" > ~/stop_storagenode.shchmod u+x ~/stop_storagenode.sh

将&移至行尾
#!/bin/sh# this script starts a jar file and creates a shellscript which can be used to stop the execution.nohup java -jar ~/storagenode.jar > ~/storagenode.log &pId=$!echo "kill $pId" > ~/stop_storagenode.shchmod u+x ~/stop_storagenode.sh