参考博客:nohup sh xxx.sh &>out.log &
nohup sh xxx.sh &>out.log &
同时使用nohup 和 & 能使执行脚本时,终端不被占用。
nohup : 不挂断执行。
&: 后台运行。
&>out.log: 输出定向到out.log文件。
&>>out.log: 输出追加到out.log文件。
注意:
sh xxx.sh
后可以接多个参数。
&>out.log
之间不能有空格。