Re: [O] How to use org mode shell with ssh?

2016-09-23 Thread Xi Shen
I got it :) After reading http://orgmode.org/cgit.cgi/org-mode.git/tree/lisp/ob-shell.el#n57, I found I can simply specify the shell name in the block. On Fri, Sep 23, 2016 at 6:50 PM Fabrice Popineau < fabrice.popin...@centralesupelec.fr> wrote: > 2016-09-23 10:32 GMT+02:00 Xi Shen

Re: [O] How to use org mode shell with ssh?

2016-09-23 Thread Fabrice Popineau
2016-09-23 10:32 GMT+02:00 Xi Shen : > Hi, > > On my Windows system, I have Cygwin setup, with Emacs as part of the > Cygwin installation. > Cygwin Emacs is not a native Emacs (AFAIK). The difference is in the way it groks pathnames and other stuff like the default shell.

Re: [O] How to use org mode shell with ssh?

2016-09-23 Thread Xi Shen
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

Re: [O] How to use org mode shell with ssh?

2016-09-22 Thread Fabrice Popineau
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

Re: [O] How to use org mode shell with ssh?

2016-09-22 Thread Colin Baxter
On Thu, Sep 22 2016, Xi Shen wrote: > Instead of using ssh, I tried with scp. This time I got a different error. > > #+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

Re: [O] How to use org mode shell with ssh?

2016-09-22 Thread Nick Dokos
Colin Baxter 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

Re: [O] How to use org mode shell with ssh?

2016-09-22 Thread David A. Gershman
I'm not familiar with remote execution like this, but are you specifying /zsh/ on the Windows side or is it somehow inherently being assumed for the remote? A quick little hack to try may be to copy the /zsh/ executable on Windows to /ash/ and see if it fools the remote side. On 09/22/2016 07:00

Re: [O] How to use org mode shell with ssh?

2016-09-22 Thread Nick Dokos
Xi Shen writes: > Instead of using ssh, I tried with scp. This time I got a different error. > > #+BEGIN_SRC shell :dir /scp:openwrt:/mnt/sda1 > ls -al > #+END_SRC > Try opening the file in tramp directly - that should tell you where the error lies: tramp or org? > The

Re: [O] How to use org mode shell with ssh?

2016-09-22 Thread Xi Shen
Instead of using ssh, I tried with scp. This time I got a different error. #+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

Re: [O] How to use org mode shell with ssh?

2016-09-22 Thread Xi Shen
Hi, I just tried with: #+BEGIN_SRC shell :dir /ssh:openwrt:/mnt/sda1 ls -al #+END_SRC But still got the same error. I wonder on which end threw me this error. Maybe it is because I am using Emacs on Windows, and some thing is missing? Or maybe it is because the remote system is OpenWRT which

Re: [O] How to use org mode shell with ssh?

2016-09-22 Thread Colin Baxter
On Wed, Sep 21 2016, William Denton wrote: > On 22 September 2016, Xi Shen wrote: > >> #+BEGIN_SRC sh :dir /sshx:openwrt:/mnt/sda1 >> ls -al >> #+END_SRC > > Just use ssh, not sshx, and it should work. > > Bill In babel it is now (shell . t). The form (sh . t) is depreciated as from org-mode

Re: [O] How to use org mode shell with ssh?

2016-09-21 Thread William Denton
On 22 September 2016, Xi Shen wrote: #+BEGIN_SRC sh :dir /sshx:openwrt:/mnt/sda1 ls -al #+END_SRC Just use ssh, not sshx, and it should work. Bill -- William Denton :: Toronto, Canada :: https://www.miskatonic.org/ Caveat lector.

[O] How to use org mode shell with ssh?

2016-09-21 Thread Xi Shen
Hi, I tried this block #+BEGIN_SRC sh :dir /sshx:openwrt:/mnt/sda1 ls -al #+END_SRC But I got byte-code: Method `sshx' should specify both encoding and decoding command or an scp program But I could not find a way to define the encoding/decoding command... -- Thanks, David S.