I want to open a bunch of ssh sessions, how to script it?

I want to open a bunch of ssh sessions, how to script it?

am 01.02.2008 16:08:15 von Giff

Hi all,

I hope you could give me a hand in what I am trying to achieve:

I want to write a bash script to open a number of ssh connections to
certain computers and then launch a couple of commands on each of them.
I would like to open a separate tab (from the main konsole - I use kde)
for each ssh session.

Any hint?

So far I only managed to open the ssh connections, but on different
konsoles...

PS today I attempted bash scripting for the first time, don't be hard on
me :)

Re: I want to open a bunch of ssh sessions, how to script it?

am 01.02.2008 17:13:36 von jellybean stonerfish

On Fri, 01 Feb 2008 16:08:15 +0100, Giff wrote:

> Hi all,
>
> I hope you could give me a hand in what I am trying to achieve:
>
> I want to write a bash script to open a number of ssh connections to
> certain computers and then launch a couple of commands on each of them.
> I would like to open a separate tab (from the main konsole - I use kde)
> for each ssh session.
>
> Any hint?
>
> So far I only managed to open the ssh connections, but on different
> konsoles...
>
> PS today I attempted bash scripting for the first time, don't be hard on
> me :)

If you use gnome-terminal you can open a window with tabs like this

gnome-terminal --window-with-profile=Default \
--tab-with-proile=Default --tab-with-profile=Default

I don't know how to send a command to the tabs.

Re: I want to open a bunch of ssh sessions, how to script it?

am 01.02.2008 17:35:38 von Giff

jellybean stonerfish wrote:

>
> If you use gnome-terminal you can open a window with tabs like this
>
> gnome-terminal --window-with-profile=Default \
> --tab-with-proile=Default --tab-with-profile=Default
>

Thanks, I had figure that out already.

> I don't know how to send a command to the tabs.

This is still left to do...

Re: I want to open a bunch of ssh sessions, how to script it?

am 01.02.2008 18:34:18 von Bill Marcum

On 2008-02-01, jellybean stonerfish wrote:
>
>
> If you use gnome-terminal you can open a window with tabs like this
>
> gnome-terminal --window-with-profile=Default \
> --tab-with-proile=Default --tab-with-profile=Default
>
> I don't know how to send a command to the tabs.

You can have "-e command" for each tab. I don't think you can open new
tabs on an existing terminal from the command line. For that you could
use GNU screen.