zsh-users
 help / color / mirror / code / Atom feed
From: lilydjwg <lilydjwg@gmail.com>
To: zsh-users@zsh.org
Subject: Re: Running additional shell startup commands
Date: Thu, 30 Jul 2015 15:49:02 +0800	[thread overview]
Message-ID: <20150730074902.GA16612@lilyforest> (raw)
In-Reply-To: <20150730062419.GA9760@linux.vnet.ibm.com>

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


      parent reply	other threads:[~2015-07-30  7:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30  6:24 Dominik Vogt
2015-07-30  7:45 ` Mateusz Karbowy
2015-07-30  7:55   ` Dominik Vogt
2015-07-30  9:31     ` Julien Jehannet
2015-07-30  7:49 ` lilydjwg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150730074902.GA16612@lilyforest \
    --to=lilydjwg@gmail.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).