From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Leha Subject: Re: [babel] problem with sh blocks Date: Mon, 20 Feb 2012 18:51:05 +0100 Message-ID: <878vjxcs1i.fsf@med.uni-goettingen.de> References: <87k43ic5c9.fsf@med.uni-goettingen.de> <87d399mpq4.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:56188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzXOs-0006Jt-UK for emacs-orgmode@gnu.org; Mon, 20 Feb 2012 12:51:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RzXOo-0003fQ-53 for emacs-orgmode@gnu.org; Mon, 20 Feb 2012 12:51:46 -0500 Received: from plane.gmane.org ([80.91.229.3]:52213) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RzXOo-0003fB-06 for emacs-orgmode@gnu.org; Mon, 20 Feb 2012 12:51:42 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1RzXOm-0004iN-3n for emacs-orgmode@gnu.org; Mon, 20 Feb 2012 18:51:40 +0100 Received: from p57b67821.dip.t-dialin.net ([87.182.120.33]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 20 Feb 2012 18:51:39 +0100 Received: from andreas.leha by p57b67821.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 20 Feb 2012 18:51:39 +0100 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: emacs-orgmode@gnu.org Eric Schulte writes: Hi Eric, > 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 >> >> thanks a lot! The org-babel-sh-command did the trick! Cheers, Andreas