On Oct 19, 2012, at 3:50 PM, LuKreme <[email protected]> wrote:
> When I ssh in to my other Macs I want to always execute a command like
> `screen` as the first thing I do. However, I don't want to run that command
> if I am opening a terminal window directly on that machine.
>
> Basically, what I want to do is simply have an alias that does both of these
> commands:
>
> 1) ssh [email protected]
> 2) screen -DRRS Fred
>
> without having to remember to actually do the screen command. The trouble is,
> an alias will execute the ssh, and then execute the screen command AFTER the
> ssh terminates, not sending it to execute eon the remote Mac.
>
> So, I was hoping there might be a way to do this in Terminal.app?
Unless I am missing something, the answer is really easy, make an alias
for:
ssh [email protected] screen -DRRS Fred
That will then tell ssh (the program) that the command you want to run
on the remote computer is 'screen' with the options '-DRRS Fred'. It has been a
while since I used 'screen', but my memory is that that should provide you with
the shell you expect. The only caveat to this is that you will be running only
'screen' on the other end. If you had .login things that you intended to run
before screen (to setup ENV variables for instance) so screen would be setup
those would not be run (or not be run until you were within the shell inside
screen).
--
Karl Kuehn
[email protected]
_______________________________________________
MacOSX-talk mailing list
[email protected]
http://www.omnigroup.com/mailman/listinfo/macosx-talk