Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Running additional shell startup commands



On Thu, Jul 30, 2015 at 07:24:19AM +0100, Dominik Vogt wrote:
> Often, I ssh to another machine, and the first thing I do there is
> to change the working directory, e.g.
> 
>   $ ssh <some machine>
>   $ cd ~/src/git/...
> 
> I'm looking for a way to specify that in some way on the ssh
> command line but cannot figure out how to do that.  Zsh takes
> either input from stdin, or from a command specified with -c, or
> from a script, so things like
> 
>   $ ssh <...> zsh -c 'cd ~/src/git' -s
> [...]

I would use this for that:

ssh -t host 'sh -c "cd ~/src/git && exec zsh -l"'

-- 
Best regards,
lilydjwg



Messages sorted by: Reverse Date, Date, Thread, Author