[clug] ssh to box, run shell command, then leave shell open?

Adam Thomas adam.lloyd at gmail.com
Thu Apr 14 23:37:50 MDT 2011


Hi,

On 15 April 2011 15:32, Carlo Hamalainen <carlo.hamalainen at gmail.com> wrote:
> Hi,
>
> I often find myself doing this at work:
>
> $ ssh someone at remotebox
> $ source lots_of_dev_variables.sh
> $ cd /projects/blah/blah/blah
> (then I do stuff in the shell)

You could add the 2nd two steps to your .bash_profile (on the remote
box), which will mean that they get run when you login.

>
>
> Is it possible to automate the first three steps? There are a few
> answers on stackoverflow for this kind of question but they often
> involve running bash at the end of the ssh command, and that stuffs up
> environment variables
>
> --
> Carlo Hamalainen
> http://carlo-hamalainen.net
> --
> linux mailing list
> linux at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux
>


More information about the linux mailing list