I have a script that I want to use to open new terminals and type commands in them. A command like
gnome-terminal
opens a new terminal.
Also, if I do
gnome-terminal -e myprogram1
it will execute myprogram1 in the newly opened terminal. But what if, after myprogram1 completes, I want to execute myprogram2? I cannot do something like
gnome-terminal -e myprogram2
because it will open a new terminal.
Is there a way to specify in the script that I want to execute both myprogram1
and myprogram 2
in the same new terminal? Or would I have to create a new script and do something like
gnome-terminal -e scriptToExecuteMyPrograms1And2
Best Answer
You can accomplish what you want like this:
This will open up
<cmd1>
, when that's complete, it will open up<cmd2>
, finally it will leave you at a command promptexec $SHELL
.For example:
Runs
vim
, if I close the 1stvim
, a 2ndvim
is started. When the 2nd one closes I'm left at a terminal prompt.