I am trying to write a bash script that waits for a keypress/input to open a new terminal and runs an infinitely looped process, and then again waits for another keypress/input to kill that process and then close that new terminal.
This is my very first bash script and I'm not very familiar with how most things work in this area. I would appreciate any kind of help.
I'm opening the new terminal and running the process like this:
gnome-terminal -- roslaunch realsense2_camera opensource_tracking.launch
My main problem is how to kill this process within my bash script and then closing the newly created terminal. I would also appreciate any help with the keypress/input stuff.
question from:
https://stackoverflow.com/questions/65877986/killing-terminating-another-terminal-from-a-bash-script 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…