Okay, so I have a dilemma that I've been staring at for too long. I tried most online solutions but they just haven't worked very well...
I have a shell file. Let's called it "a". "a" looks a lot like this:
#a.sh sh b.sh & sh c.sh &
b.sh and c.sh look a lot like this:
#b.sh run a process run this opensource software over these files and wait if condition; do sh e.sh else f.sh fi
And then c.sh:
#c.sh call some other programs call some python files call these shell files ... etc
e.sh are similar and run their own processes and stuff.
Now, as you can see, when I run "a.sh", it runs a myriad of other things. I press Ctrl+C, and the processes are still running in the background. I close the terminal; same thing. I tried to kill with ID but I just don't know how to do it for a lot of the open source software I am using. Specifically, I have, for example tried this suggestion, but how do I make
a.sh know the different processes being run in e.sh and so on so it can kill them? It hasn't been working I tell you.
Is there a command that lets me end all processes started by a shell file? I know this is so annoying but I cannot share the code as of right now. If you really need me to, I can post something that looks similar, but again, a lot of what I am doing is running software based on certain conditions and the software and shell files don't close when I hit Ctrl+C. So I am forced to
pkill -U myuser, but this is impractical.