I want to run a source code that needs four terminal A, B, C and D. There are some commands for source code running in Ubuntu.
These commands must be run in order in terminals A, B, C, D, A, B and C
. Indeed these commands are interconnected and must be executed in this specific order.
I want to automatically run the source code with shell scripting. I already have wrote a shell script that opens multiple terminals with gnome-terminal
and it works well so far:
gnome-terminal --title="A" -- bash -c "cd ~; ./myscript1; exec bash"
gnome-terminal --title="B" -- bash -c "cd ~; ./myscript2; exec bash"
gnome-terminal --title="C" -- bash -c "cd ~; ./myscript3; exec bash"
gnome-terminal --title="D" -- bash -c "cd ~; ./myscript4; exec bash"
Now I want back to terminal A
and run another command within it.
The following statement does not work fine, it opens a new terminal!
gnome-terminal --title="A" -- bash -c "cd ~; command; exec bash"
I did not understand how to do this after reading man pages of Gnome-terminal and searching in the web.