[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Happy with remote-shell $0, and its PATH
From: |
積丹尼 Dan Jacobson |
Subject: |
Happy with remote-shell $0, and its PATH |
Date: |
Sun, 03 Nov 2019 12:02:26 +0800 |
(info "(tramp) Android shell setup") says
• ‘sh’ must be specified for remote shell since Android devices do
not provide ‘/bin/sh’. ‘sh’ will then invoke whatever shell is
installed on the device with this setting:
(add-to-list 'tramp-connection-properties
(list (regexp-quote "192.168.0.26") "remote-shell" "sh"))
I have an idea,
because we are already talking to the shell,
can't we just tell it somehow to use "$0"?!
Then we don't have to worry about PATHs, nor if there is only "bash" or
"sh" there.
That way instead of sending
# exec env TERM='dumb' ... PS2='' PS3='' sh
it could send
# exec env TERM='dumb' ... PS2='' PS3='' $0
and (perhaps) always work!
In fact, as we are already in a shell, have tramp just send
# TERM='dumb' ... PS2='' PS3=''
Brilliant, no?
Furthermore, at
• TRAMP requires preserving ‘PATH’ environment variable from user
settings. Android devices prefer ‘/system/xbin’ path over
‘/system/bin’. Both of these are set as follows:
(add-to-list 'tramp-remote-path 'tramp-own-remote-path)
(add-to-list 'tramp-remote-path "/system/xbin")
what if we are happy with the path the remote ssh provides us,
and don't want to change it? I.e., tramp should just use the ls, cp, rm,
etc. that it finds on the path already in the ssh shell... so do mention
how to enforce that.
- Happy with remote-shell $0, and its PATH,
積丹尼 Dan Jacobson <=