nohup in“;bash脚本-s…”;不返回提示

nohup in“;bash脚本-s…”;不返回提示,bash,nohup,Bash,Nohup,我使用bash上传springboot包并重新启动它,但命令不会返回提示符 restart.sh: kill -9 $(lsof -t -i:10001) \ && nohup java -jar /path/to/app-0.0.1-SNAPSHOT.jar --server.port=10001 >/dev/null 2>&1 </dev/null & kill-9$(lsof-t-i:10001)\ &&nohup java-jar/pa

我使用bash上传springboot包并重新启动它,但命令不会返回提示符

restart.sh:

kill -9 $(lsof -t -i:10001) \
&& nohup java -jar /path/to/app-0.0.1-SNAPSHOT.jar --server.port=10001 >/dev/null 2>&1 </dev/null &
kill-9$(lsof-t-i:10001)\

&&nohup java-jar/path/to/app-0.0.1-SNAPSHOT.jar--server.port=10001>/dev/null 2>&1在restart.sh结束时添加&。上面的注释添加&在restart.sh结束时生效。上面的注释

您可以尝试在restart.sh的末尾添加一个“&”吗。像宋承宪root@ip“bash-s”ssh root@ip "bash -s" < restart.sh