emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org babel execute shell in sh?


From: Panruo Wu
Subject: Re: [O] org babel execute shell in sh?
Date: Fri, 9 Mar 2012 13:34:47 -0700

Thanks tom! This is exactly what I need.

regards,
robb

On Wed, Mar 7, 2012 at 9:24 PM, Tom Regner <address@hidden> wrote:
Hi,

Panruo Wu <address@hidden> writes:

> Dear list,
>
>
> #+begin_src sh 
> for np in {1..32}
> do
>     echo $np
> done
> #+end_src
>
> when executing, the output only shows
> {1..32}
> which is clearly not I want..
>
> After some investigation, I found that orgmode
> uses "sh" that cannot understand the for loop above.
>
> My question is, how can I suggest orgmode to use
> "bash" to execute shell script?
>
> I tried :shebang #!/bin/bash but it does not work

I have the following in my config:

--------------------%<--------------------------
     I really like org-babel to use zsh
     #+begin_src emacs-lisp
       (setq org-babel-sh-command "zsh")
     #+end_src
--------------------%<--------------------------

It is apparently not possible to set this variable via #+BIND: to only
change this for one code block, at least I did not succeed to do so in
my attempts to do so -- but maybe I just didn't read enough of the
documentation to /get it right/.

I don't know, if zsh||bash instead of sh breaks any assumptions org-mode
makes about the environment in which sh code blocks are executed; up
until now it works like a charm.

Kind regards,
Tom


reply via email to

[Prev in Thread] Current Thread [Next in Thread]