Multiple terminals launched from the command line, how to?
I am trying to script and automate my shell login process and want to be able to launch multiple tabs within the same window like in gnome-terminal, in gnome-terminal you can use a --tab or --tab-with-profile to open a new tab and on top of that you can call a --command to the tab and have it execute a command. I am using this to call individual shell scripts that use "expect" to automate my login process. The problem that I ran into in gnome terminal is that it doesn't seem to be able to handle more than 10 simultaneous tabs at one time on the command line. Here is an example of what I use:
#!/bin/bash
#Define Variables for individual scripts to be passed as arguements to the gnome-terminal command for opening up a single window w/ many tabs.
HOST1="
HOST2="
HOST3="
HOST4="
HOST5="
HOST6="
HOST7="
HOST8="
HOST9="
HOST10=
HOST11=
HOST12=
HOST13=
HOST14=
HOST15=
HOST16=
HOST17=
HOST18=
HOST19=
HOST20=
HOST21=
HOST22=
HOST23=
HOST24=
HOST25=
#Actual command string run as one command to open up all shells in a single window with multiple tabs
gnome-terminal --tab-with-
gnome-terminal --tab-with-
gnome-terminal --tab-with-
gnome-terminal --tab-with-
gnome-terminal --tab-with-
sleep 3
echo "First group of 10 complete......"
sleep 5
#Looks like we need to split them into groups of 10, doesn't seem it executes more than that
gnome-terminal --tab-with-
gnome-terminal --tab-with-
gnome-terminal --tab-with-
gnome-terminal --tab-with-
gnome-terminal --tab-with-
sleep 3
echo "Second group of 10 complete......"
The thing is that this gnome-terminal documentation is poor. It claims in the gnome-terminal --help that you can connect a tab to the last opened window, but what I have found is that everytime you execute the command more than once using the tabs as flags, ex. gnome-terminal --tab --tab --tab , it opens a new window with in this example 3 tabs. If you execute the command again, it will open a new window with 3 more tabs, it doesn't connect the new 3 tabs to the existing previously opened terminal with the 3 tabs that was already opened. My goal is to open many tabs (example 50) at a time and automate the login process. Some people say to use keys, the problem is, I am using a key pair and a username and pass that talks to a ldap auth server (this is for PCI compliance.), so it is more complicated than that. Thus the reason for individual shell scripts. It would be nice if you had a command line flag that you could execute the tab with and then tie in the --command flag along with that tab so that the shell is executed within that tab'd terminal. I tried using SCREEN, but this is not as nice as it is harder to shift between windows quickly. I like the ctl + pgup, ctl + pgdown in the gnome-terminal as it is fast and I can execute and copy and paste commands very quickly this way and move back and forth between windows faster to view logs and output. There was another program called Multi Gnome Terminal but they stated that Ubuntu has stopped including it prior to hardy. I am using hardy and intrepid. To compile it from what I read is a pain, and I tried it quickly but it failed. I don't think I want to use a product that isn't included in the distro anymore. There were several bugs opened on launchpad regarding how gnome-terminal opens tabs, but the dev guys said that it isn't a bug and that the documentation is not clear. But the way it is working is how it is supposed to work, which is when you run the command it opens a new window for each command run. You cannot execute another command instance and expect the tabs to be opened in the previous window.
Let me know if and when you guys are planning to implement a command line flag that can execute more than 10 shells with the --command flag at a time. It would be really nice.
I spent about 7 hours working on trying to find a solution under linux in gnome. I would really like to find an elegant solution, unfortunately I couldn't seem to find an answer on google. I used to use a program in windows called SecureCRT, and it was nice, but I would never go back to windows and they don't offer a version for linux. You can get it to run under wine and supposedly it's more stable, but that to me is a crappy way to do things. We should be able to use the native linux terminal programs to do this.
Thanks.
shaggy_surfer
Question information
- Language:
- English Edit question
- Status:
- Answered
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask shaggy_surfer for more information if necessary.