setting current dir of remote shell
Dave Yost
Dave at Yost.com
Sat Apr 28 05:40:47 EST 2007
I assume you mean
ssh -t someserver "cd $(pwd) && exec \$0 -l"
This works well enough that I've updated yostupload to use it.
http://Yost.com/computers/yostupload
But is this the final word for ssh? Should there be a more formal facility that works for shells that don't support -l ?
Thanks!
Dave
At 11:20 AM -0600 2007-04-27, Bob Proulx wrote:
> > Darren Tucker wrote:
>> It's not exactly the same as a login shell but it's close:
>> ...
>> ssh -t someserver "cd `pwd` && exec $SHELL -"
>
>If the shell supports it then the -l extension (e.g. bash) can enable
>it to be a login shell and then it would be the same.
>
> ssh -t someserver "cd $(pwd) && exec -l $SHELL"
>
>However that does make for a funny looking $0.
>
> echo $0
> -/bin/bash
>
>For me the following works:
>
> ssh -t someserver "cd $(pwd) && exec -l \$0"
> $ echo $0
> -bash
>
>Bob
More information about the openssh-unix-dev
mailing list