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: Nick Dokos
Subject: Re: [O] org babel execute shell in sh?
Date: Wed, 07 Mar 2012 19:22:38 -0500

Panruo Wu <address@hidden> wrote:

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

Not a solution, just a workaround: you can write the loop
as

--8<---------------cut here---------------start------------->8---
#+begin_src sh
for np in $(seq 1 32)
do
   echo $np
done
#+end_src
--8<---------------cut here---------------end--------------->8---

Nick



reply via email to

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