我从我的shell脚本开始后台进程,我想在脚本完成时终止这个进程.
如何从我的shell脚本中获取此进程的PID?据我所知,变量$!包含当前脚本的PID,而不是后台进程.
$!
linux shell pid background-process
background-process ×1
linux ×1
pid ×1
shell ×1