I routinely open a lot of Terminal windows each with an ssh session. To streamline the process I have a series of shell scripts that look like this:
#!/bin/sh
osascript <<EOS
tell application "Terminal"
activate
do script "set_background_color salmon; ssh alan@demo.znyx.com"
end tell
EOS
This works. I can either execute the script from a shell prompt or click it in the Finder window. (To do this the file name suffix is .command instead of .sh)
The problem is that when I execute it from Finder, I end up with a dead window ("Process Completed") behind the window I intended to open. Is there any way to get rid of it or not have it open in the first place?
UPDATE:
The solution in this other question results in dialog boxes appearing that provide confirm/review/cancel options. This is undesirable.