emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Xi Shen <davidshen84@gmail.com>
To: fabrice.popineau@centralesupelec.fr, Nick Dokos <ndokos@gmail.com>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: How to use org mode shell with ssh?
Date: Fri, 23 Sep 2016 08:32:33 +0000	[thread overview]
Message-ID: <CANO68EMHg0rhT98D2rDTCfSdfBnx+heLx_SEyJw9uXzCNVB13Q@mail.gmail.com> (raw)
In-Reply-To: <CAFgFV9O_kv2gJbvAG=0XyCV6=wfyLpYTd9+Ez04BRdnQ2q8ECw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3220 bytes --]

Hi,

On my Windows system, I have Cygwin setup, with Emacs as part of the Cygwin
installation. I also setup my Cygwin environment to use zsh. I started my
Emacs from this zsh environment. I think that's where org inherited this
setting.

I think when org execute my block, it some how assumed that it should use
the same shell at the remote end.

P.S. OpenWRT is the router OS. It is just a tiny Linux. Most people would
not install zsh on it :P


On Fri, Sep 23, 2016 at 4:35 AM Fabrice Popineau <
fabrice.popineau@supelec.fr> wrote:

> My $0.02
>
> As I'm using Emacs on Windows, with MSYS2+MingW64, I tried this.
> There is a problem with using bash from a _native_ MingW64 Emacs:
> bash is a MSYS2 app and Emacs is a MingW64 app.
>
> From emacs, I would have used the plink protocol, so that's what I did.
> And I got this message in the *Org-Babel Error Output* buffer
>
> /bin/sh: 1: C:/Local/Emacs/bin/cmdproxy.exe: not found
>
> So I looked at ob-eval.el and the org-babel-eval function.
> And there are at least 2 big problems.
> 1- when entering this function, the `command' parameter is
> "C:/Local/Emacs/bin/cmdproxy.exe"
> 2 - the `shell-file-name' variable has the same value
> So the following won't work for Windows :
>         ;; Unfortunately, `executable-find' does not support file name
> ;; handlers.  Therefore, we could use it in the local case
> ;; only.
> (shell-file-name
> (cond ((and (not (file-remote-p default-directory))
>     (executable-find shell-file-name))
> shell-file-name)
>       ((file-executable-p
> (concat (file-remote-p default-directory) shell-file-name))
> shell-file-name)
>       ("/bin/sh")))
>
> BTW I don't see the point concatenating shell-file-name with
> default-directory when the later is remote.
> Do we expect to find the shell in the remote directory ?
>
> Anyway, there is little chance this stuff will work under Windows with a
> native Emacs.
> If I find time, I may try to propose some fix.
>
> Fabrice
>
>
> 2016-09-22 16:52 GMT+02:00 Nick Dokos <ndokos@gmail.com>:
>
>> Colin Baxter <m43cap@yandex.com> writes:
>>
>>
>> >> #+BEGIN_SRC shell :dir /scp:openwrt:/mnt/sda1
>> >> ls -al
>> >> #+END_SRC
>> >>
>> >> The error, I think, is from the remote end.
>> >>
>> >> /bin/sh: /bin/zsh: not found
>> >>
>> >> Clearly, I am using zsh on my Windows, but my remote OpenWRT system
>> only has ash installed. Is
>> >> there's way to specify the shell to use on the remote end?
>> >>
>> >
>> > I can't help you here. I've never used openwrt. All I can suggest is to
>> > search openwrt documentation or try with cgywin.
>> >
>>
>> IIUC, openwrt is the name of the remote node - nothing to do with OpenWrt
>> (except of course, that
>> the remote node may be a router which has been flashed with OpenWrt, but
>> that should make no
>> difference to ssh/tramp).
>>
>> --
>> Nick
>>
>>
>>
>
>
> --
> Fabrice Popineau
> -----------------------------
> SUPELEC
> Département Informatique
> 3, rue Joliot Curie
> 91192 Gif/Yvette Cedex
> Tel direct : +33 (0) 169851950
> Standard : +33 (0) 169851212
> ------------------------------
>
> --


Thanks,
David S.

[-- Attachment #2: Type: text/html, Size: 5144 bytes --]

  reply	other threads:[~2016-09-23  8:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22  1:02 How to use org mode shell with ssh? Xi Shen
2016-09-22  1:15 ` William Denton
2016-09-22  8:52   ` Colin Baxter
2016-09-22 12:15     ` Xi Shen
2016-09-22 12:37       ` Xi Shen
2016-09-22 14:00         ` Colin Baxter
2016-09-22 14:45           ` David A. Gershman
2016-09-22 14:52           ` Nick Dokos
2016-09-22 20:30             ` Fabrice Popineau
2016-09-23  8:32               ` Xi Shen [this message]
2016-09-23 10:49                 ` Fabrice Popineau
2016-09-24  0:40                   ` Xi Shen
2016-09-22 14:38         ` Nick Dokos

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=CANO68EMHg0rhT98D2rDTCfSdfBnx+heLx_SEyJw9uXzCNVB13Q@mail.gmail.com \
    --to=davidshen84@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=fabrice.popineau@centralesupelec.fr \
    --cc=ndokos@gmail.com \
    /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.savannah.gnu.org/cgit/emacs/org-mode.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).