In my Mac, how do I write a script that can do this?
- Open "terminal".
- In that terminal, "ssh myserver"
- Open a new "tab" inside the terminal.
- In that tab, "ssh myserver2"
Then, how would I run this script?
|
In my Mac, how do I write a script that can do this?
Then, how would I run this script?
| ||||
|
feedback
|
|
Open
Save as script or application. Anytime you execute, Terminal will be brought to front (started if necessary), and two new tabs will be created for your SSH sessions. In this answer I outlined how to check whether a window is already open (without an application running) to prevent opening one tab/window too many. | ||||
|
feedback
|
|
You can create a Window Group to make it convenient to recreate windows and tabs, and you can use Settings profiles to issue ssh commands when windows/tabs are created.
Now, whenever you want to recreate that window and start the ssh sessions, choose Window > Open Window Group > [your group]. You can also tell Terminal to open the window group every time you start Terminal (Terminal > Preferences > Startup > On startup, open: > Window group:). | |||
|
feedback
|
|
Use iTerm 2 (scroll down to profiles)
| |||
|
feedback
|
|
This would probably be best accomplished with AppleScript. You can save it as an executable if you like. | |||
|
feedback
|