shell脚本研习

sehll基础:

https://www.runoob.com/linux/linux-shell-variable.html

mysql备份脚本:

https://www.cnblogs.com/tengfei520/p/7928700.html

shell基础问题:

https://blog.csdn.net/qq_42914528/article/details/93149000

shell例子:

https://www.jb51.net/article/67112.htm

直接在后台运行脚本test.sh:./test.sh &
查看当前shell环境中已启动的任务情况:jobs
将test.sh切换到前台运行:fg %number(”number”为使用jobs命令查看到的 [ ] 中的数字,不是pid)
中断后台运行的test.sh脚本:先fg %number切换到前台,再ctrl+c;或是直接kill %number

不中断的在后台运行test.sh:nohup ./test.sh &(test.sh的打印信息会输出到当前目录下的nohup.out中)
使用jobs可看到test.sh处于running状态
使用ps -ef |grep test.sh可查看到正在运行的test.sh脚本进程
退出当前shell终端,再重新打开,使用jobs看不到正在运行的test.sh,但使用ps -ef可以看到

原文地址:https://www.cnblogs.com/brxHqs/p/11590357.html