Re: setting current dir of remote shell

This is a discussion on Re: setting current dir of remote shell within the OpenSSH Development forums, part of the Networking and Network Related category; > Darren Tucker wrote: > It's not exactly the same as a login shell but it's close: > ... &...


Go Back   Usenet Forums > Networking and Network Related > OpenSSH Development

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-27-2007
Bob Proulx
 
Posts: n/a
Default Re: setting current dir of remote shell

> 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
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
http://lists.mindrot.org/mailman/lis...enssh-unix-dev
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:15 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0