1

I would like to make a script ( bash ) that will programmatically

  1. start gnome-termal with 6 tabs each with its own title
  2. start a different command in each tab
  3. delay starting server 5 until sever 4 has been running for about 1 minute
  4. change the title of the gnome terminal to "My Servers"
  5. switch tabs to the Server 4 tab

I would like to do all of this with double clicking on the file, without a dialog box ( RHEL 6 ) coming up to ask me if I want to display or run the file.

Googling around I got this far, but I could use some help with the rest:

gnome-terminal                                 \
--tab -t "Server 1"   -e commandStartServer1   \
--tab -t "Server 2"   -e commandStartServer2   \
--tab -t "Server 3"   -e commandStartServer3   \
--tab -t "Server 4"   -e commandStartServer4   \
--tab -t "Server 5"   -e commandStartServer5   \
--tab -t "Server 6"   -e commandStartServer6   \
user787832
  • 743
  • 1
  • 10
  • 18
  • Check http://superuser.com/questions/198015/open-gnome-terminal-programmatically-and-execute-commands-after-bashrc-was-execu – Gilles Quénot Dec 24 '14 at 08:12

1 Answers1

1

I can just help you with the dialog box. Create a .desktop file, that will run you executable script. You can find a quick introduction to .desktop files here or take a look at one of the files in /usr/share/applications.

As for the rest of the questions please take a look at this question.

user1403360
  • 364
  • 1
  • 4
  • That seems to have worked, at the second link you quoted what does the variable BASH_POST_RC mean? – user787832 Dec 31 '14 at 05:08
  • I successfully used the method at the second link you posted, thank you. I noticed that using that technique the command strings don't get put into the terminal or the history, just executed. Is there anyway to do that? – user787832 Dec 31 '14 at 05:09
  • if nothing else works, you could always add this command: echo 'command' >>~/.bash_history – user1403360 Dec 31 '14 at 07:53