From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: [babel] problem with sh blocks Date: Mon, 20 Feb 2012 06:59:07 -0700 Message-ID: <87d399mpq4.fsf@gmx.com> References: <87k43ic5c9.fsf@med.uni-goettingen.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:39068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzWAa-0003Cs-C2 for emacs-orgmode@gnu.org; Mon, 20 Feb 2012 11:33:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzWAU-0005SG-E3 for emacs-orgmode@gnu.org; Mon, 20 Feb 2012 11:32:56 -0500 Received: from mailout-us.gmx.com ([74.208.5.67]:48585 helo=mailout-us.mail.com) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RzWAU-0005Ri-1v for emacs-orgmode@gnu.org; Mon, 20 Feb 2012 11:32:50 -0500 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@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Andreas Leha Cc: emacs-orgmode@gnu.org Hi, As with the other recent sh-block email, the problem is likely due to the interpreter used (e.g., bash as compared to dash). See the value of `org-babel-sh-command' which defaults to "sh" which defaults to a POSIX rather than bash shell on many systems. Best, Andreas Leha writes: > 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? > > Thanks in advance, > Andreas > > -- Eric Schulte http://cs.unm.edu/~eschulte/