On Sun 14 Jun 2015, Johan W. Klüwer wrote: > I'm having difficulties passing org variables into shell source blocks. > This is using Windows 7 and Cygwin with bash shell. For instance, the > following > > #+BEGIN_SRC sh :var x="." > ls $x > #+END_SRC > > fails with the error message (as displayed in emacs) > > ls: cannot access .^M^M : No such file or directory > > > As far as I can see, the first ^M stems from org-babel-sh-var-quote-fmt, > and the second from org-babel-expand-body:generic, but I haven't been able > to figure out a solution. Any suggestions?
I can reproduce this using the native Windows build of emacs. If you are using cygwin tools, consider using a cygwin build of emacs, which will not suffer from this problem. If you running an X server then the cygwin emacs-X11 package is what you need. If you don't want to run an X server then the emacs-w32 package may fit your needs (a cygwin native build of emacs that uses the Windows GUI for display). HTH, AndyM