emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Trouble passing variables into shell blocks on windows
@ 2015-06-14 13:13 Johan W. Klüwer
  2015-06-15  8:12 ` Rainer M Krug
  2015-06-16 13:28 ` Andy Moreton
  0 siblings, 2 replies; 5+ messages in thread
From: Johan W. Klüwer @ 2015-06-14 13:13 UTC (permalink / raw)
  To: emacs-orgmode

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

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?

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Trouble passing variables into shell blocks on windows
  2015-06-14 13:13 Trouble passing variables into shell blocks on windows Johan W. Klüwer
@ 2015-06-15  8:12 ` Rainer M Krug
  2015-06-23  7:28   ` Johan W. Klüwer
  2015-06-16 13:28 ` Andy Moreton
  1 sibling, 1 reply; 5+ messages in thread
From: Rainer M Krug @ 2015-06-15  8:12 UTC (permalink / raw)
  To: Johan W. Klüwer; +Cc: emacs-orgmode

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

Johan W. Klüwer <johan.w.kluwer@gmail.com> writes:

> 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)

Works on OS X Yosemite,

,----
| Org-mode version 8.3beta (release_8.3beta-1209-gc532ff @ /Users/rainerkrug/.emacs.d/org-mode/lisp/)
| GNU Emacs 24.5.1 (x86_64-apple-darwin14.3.0, Carbon Version 157 AppKit 1347.57) of 2015-04-13 on Rainers-MacBook-Pro.local
`----

Cheers,

Rainer

>
>   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?

-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug

PGP: 0x0F52F982

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 480 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Trouble passing variables into shell blocks on windows
  2015-06-14 13:13 Trouble passing variables into shell blocks on windows Johan W. Klüwer
  2015-06-15  8:12 ` Rainer M Krug
@ 2015-06-16 13:28 ` Andy Moreton
  1 sibling, 0 replies; 5+ messages in thread
From: Andy Moreton @ 2015-06-16 13:28 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Trouble passing variables into shell blocks on windows
  2015-06-15  8:12 ` Rainer M Krug
@ 2015-06-23  7:28   ` Johan W. Klüwer
  2015-06-23  8:50     ` Sebastien Vauban
  0 siblings, 1 reply; 5+ messages in thread
From: Johan W. Klüwer @ 2015-06-23  7:28 UTC (permalink / raw)
  Cc: emacs-orgmode

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

Thank you for the information -- I suppose the cygwin version of emacs may
be the only viable option. Still that seems like quite a big change,
swapping emacs versions, just for this particular feature.

2015-06-15 10:12 GMT+02:00 Rainer M Krug <Rainer@krugs.de>:

> Johan W. Klüwer <johan.w.kluwer@gmail.com> writes:
>
> > 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)
>
> Works on OS X Yosemite,
>
> ,----
> | Org-mode version 8.3beta (release_8.3beta-1209-gc532ff @
> /Users/rainerkrug/.emacs.d/org-mode/lisp/)
> | GNU Emacs 24.5.1 (x86_64-apple-darwin14.3.0, Carbon Version 157 AppKit
> 1347.57) of 2015-04-13 on Rainers-MacBook-Pro.local
> `----
>
> Cheers,
>
> Rainer
>
> >
> >   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?
>
> --
> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
> Biology, UCT), Dipl. Phys. (Germany)
>
> Centre of Excellence for Invasion Biology
> Stellenbosch University
> South Africa
>
> Tel :       +33 - (0)9 53 10 27 44
> Cell:       +33 - (0)6 85 62 59 98
> Fax :       +33 - (0)9 58 10 27 44
>
> Fax (D):    +49 - (0)3 21 21 25 22 44
>
> email:      Rainer@krugs.de
>
> Skype:      RMkrug
>
> PGP: 0x0F52F982
>

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Trouble passing variables into shell blocks on windows
  2015-06-23  7:28   ` Johan W. Klüwer
@ 2015-06-23  8:50     ` Sebastien Vauban
  0 siblings, 0 replies; 5+ messages in thread
From: Sebastien Vauban @ 2015-06-23  8:50 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Johan W. Klüwer <johan.w.kluwer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> Thank you for the information -- I suppose the cygwin version of emacs may
> be the only viable option. Still that seems like quite a big change,
> swapping emacs versions, just for this particular feature.
>
> 2015-06-15 10:12 GMT+02:00 Rainer M Krug <Rainer-vfylz/Ys1k4@public.gmane.org>:
>> Johan W. Klüwer <johan.w.kluwer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>> 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)

I dunno what's the real impact of that, but pay attention that the "sh"
language has been renamed "shell" quite a long time ago (more than one
year IIRC).

Best regards,
  Seb

-- 
Sebastien Vauban

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-06-23  8:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-14 13:13 Trouble passing variables into shell blocks on windows Johan W. Klüwer
2015-06-15  8:12 ` Rainer M Krug
2015-06-23  7:28   ` Johan W. Klüwer
2015-06-23  8:50     ` Sebastien Vauban
2015-06-16 13:28 ` Andy Moreton

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).