The title is ambiguous, so I add example.
I usually run python files by bash file.
Bash file name : train.sh
python train1.py
python train2.py
Then I run nohup bash train.sh > out.out &.
So, train1.py and train2.py are run sequentially.
And when I found mistakes, I stopped using check PID using nvidia-smi and kill -9 PID .
However, of cousre, only train1.py stopped and then start train2.py.
What I want to do is.
I want stop both train1.py and train2.py even if current running file is train1.py.
In other words, I want stop running python file and files to be ran.
And I have one more question.
How can I get PIDs for running bash files?
(Assuming that 2 bash files like above example are running, I want to get PIDs for each.)
Thank You