Levent
Levent

Reputation: 27

How to create a script that opens multiple terminals and runs different programs on them?

Good day everyone,

I am working on a project that requires me to have 7+ programs (no GUI, runs on shell) open, all interacting with each other. For example, Program 1 asks a question to Program 2, and it uses Program 3 and 4 to solve that etc.

So what I do is, I open many terminals and run each one on a different terminal, then I place them on my screen and go ahead. But this is a troublesome process, as every time I need to recompile I need to run them all one by one again, even worse, if I ever turn my computer off, I need to open many shells, go to the directories, run them all so and so.

What I want is a file that would open the necessary terminal windows for me and go to the correct directory on each, then run the programs. I don't know much about shell-scripts, but I assumed this must have been possible. Can you give me any directions? Note that the programs should not run in background or in different tabs. I need to be constantly observing the displays.

I have read this post about a similar issue but that does not work for me, because I need them on different terminals.

Thank you.

Upvotes: 2

Views: 1895

Answers (1)

Antonio Petricca
Antonio Petricca

Reputation: 11026

We suppose you are using gnome terminale, so the command would be:

gnome-terminal --working-directory "{{APP_FOLDER}}" --command "{{APP_EXCUTABLE}}"

That approach can be traslated to any other terminal emulator.

Upvotes: 2

Related Questions