test_nohup.sh
#!/bin/sh
#nohup
sleep 60;
echo '60' >> 60.txt
执行终端命令
nohup sh test_nohup.sh
关闭SSH连接。
过1分钟后再打开,会发现生成了文件60.txt
test_nohup.sh
#!/bin/sh
#nohup
sleep 60;
echo '60' >> 60.txt
执行终端命令
nohup sh test_nohup.sh
过1分钟后再打开,会发现生成了文件60.txt