Is there a simple configuration to get org-babel to invoke cmd.exe that doesn't involve modifying the org-babel source?
Googling for ["org-babel" sh "cmd"] finds this email list discussion from 2010: Re: [Orgmode] org-babel-sh and Microsoft Windows
but that looks like a blanket solution, not one that could be applied on a per-block or per-file, as I'd want to able to run sh/bash too.
(This is for literate DevOps of windows servers, so "use sh/bash/zsh" is unfortunately not a option.)
(run-shell-command "cmd /c start cmd /k dir")
in the past. Perhaps you can tweak that for individual babel blocks.run-shell-command
in(run-shell-command "cmd /c start cmd /k dir")
usesshell-file-name
which is set tobash
. This cannot be let-set in a around advice oforg-babel-sh-evaluate
becauseorg-babel--shell-command-on-region
uses(process-file shell-file-name input-file ... shell-command-switch command)
withshell-command-switch
equal to "-c" andcommand
set toorg-babel-sh-command
. So the shell is invoked twice. Setting the switches and command to nil does not work (error stringp). One would need a new org-babel language to avoid shob-sh-el
to a new languageob-cmd.el
and edit it to work with cmd.emacs-version
output? Note, a (big) problem is also process-communication withcmd.exe
viastdin
andstdout
.GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) of 2015-09-07
on Windows 7. Specifically, this build: sourceforge.net/projects/emacsbinw64/files/snapshot/… (I also have git-bash on%PATH%
and in emac'sexec-path
)