N
N
Nomad2019-08-21 19:21:48
linux
Nomad, 2019-08-21 19:21:48

How to write a script in bash to open multiple terminal windows?

Good afternoon. You need to create a script to run several commands. I just started learning bash scripting and didn't find much information on my question.
And so:
The script should open a terminal, htop is displayed in the first terminal, then a second terminal window opens.
(I will be glad to textbooks in Russian on bash)
Thanks in advance

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
dpsz, 2019-08-22
@dpsz

As they said above, this does not apply to bash, but if you want to run several, for example, tabs, then there is nothing easier. For example, for mate-terminal
mate-terminal --maximize --window -e "htop" --tab -e "top" --tab -e "atop" and so on.
For xterm
xterm -e htop & xterm -e top & xterm -e atop & etc.
And in general, there is mana for each terminal emulator.

A
arsenty, 2019-08-21
@arsenty

It will help to create and control sessions / windows tmux, and run all this with one command -tmuxinator

B
BorLaze, 2019-08-21
@BorLaze

No way. This does not apply to the tower.
This has to be supported by the terminal somehow; But, I must admit, I have never heard of such a thing.

S
sergey, 2019-08-22
kuzmin @sergueik

or screen
https://www.gnu.org/software/screen/manual/screen.html
but opening a lot is high aerobatics, I advise you to start with something easier

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question