From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: [babel] problem with sh blocks Date: Mon, 20 Feb 2012 09:56:33 +0100 Message-ID: <8039a56fy6.fsf@somewhere.org> References: <87k43ic5c9.fsf@med.uni-goettingen.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Andreas Leha, Andreas Leha wrote: > Hi all, > > why is it, that I can not use this code in sh blocks (I get sh: 2: Bad > substitution), even though it is valid when I run the tangled > script? Is this a known thing? > > #+begin_src sh :shebang "#!/bin/bash" :tangle test.sh > for i in *.org; do > echo cp "$i" "${i/%.org/.bak.org}" > done > #+end_src > > How can I get the above block to execute? I just copied your block into a fresh "test.org" file, and eval'ed the code block: #+begin_src sh :shebang "#!/bin/bash" :tangle test.sh for i in *.org; do echo cp "$i" "${i/%.org/.bak.org}" done #+end_src #+results: | cp | test-export4.org | test-export4.bak.org | | cp | test-export5.org | test-export5.bak.org | | cp | test-export7.org | test-export7.bak.org | Works perfectly for me, it seems, on: GNU Emacs 24.0.92.1 (i386-mingw-nt5.1.2600) of 2012-01-23 on MARVIN Org-mode version 7.8.03 (release_7.8.03.410.g77fb) Best regards, Seb -- Sebastien Vauban