From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: org babel execute shell in sh? Date: Mon, 12 Mar 2012 13:29:02 -0400 Message-ID: <87aa3ld8yp.fsf@gmx.com> References: <87fwdj67q2.fsf@goochesa.de> <3596.1331353274@alphaville> <87pqchg6ab.fsf@gmx.com> <874ntt6ah1.fsf@goochesa.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S793r-0005G3-Ji for emacs-orgmode@gnu.org; Mon, 12 Mar 2012 13:29:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S793p-0006VW-4U for emacs-orgmode@gnu.org; Mon, 12 Mar 2012 13:29:31 -0400 Received: from mailout-us.gmx.com ([74.208.5.67]:60493 helo=mailout-us.mail.com) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1S793o-0006UY-UM for emacs-orgmode@gnu.org; Mon, 12 Mar 2012 13:29:29 -0400 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: Tom Regner Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org, Panruo Wu Tom Regner writes: > Eric Schulte writes: > >>> >>> But I'm often bitten by the distinction between export and tangling -- >>> :padline, :shebang come to mind, where I expected org-babel to honour >>> the setting in both cases. >>> >> >> Could you describe a use case where these options would be used for >> exporting and would be preferable to simply including the padding lines >> or the shebang literally in the code block? > > I use an LP org-document with zsh-codefragments to generate a CLIF > testplan - the script is tangled, then executed and the output -- the > generated .ctp file -- exported. In this case I'd prefere it to have the > shell from the :shebang option used to run the tangled program, not > /bin/sh, so that exporting the output inside the document and running > the tangled program standalone produce the same result. > > At the moment I have to set the shell document- or session-wide to zsh > to get reproducible behaviour. > > Whenever the export/execution is part of the generated document and of > the generated product (the tangled code) I would like it, not to have to > sides to configure. > > I don't know, if I make myself clear -- If not, please tell me so and I > try to distill an example out of the cases I encountered at work, where > I was wondering why some things did not work as I expected. > I think I understand now, so it is "execution" not "export" behavior which could make use of the :shebang header argument. I suppose that it would be possible to allow the :shebang header argument to silently override the value of the `org-babel-sh-command' variable when it is present. I just pushed up a patch which adds this behavior. It does result in some odd new possibilities, such as the following. #+begin_src sh :shebang #!/bin/cat foo #+end_src #+RESULTS: | #!/bin/cat | | | | foo | Best, > > Kind regards, > Tom -- Eric Schulte http://cs.unm.edu/~eschulte/