From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: Is it possible to run shell script src blocks as root or to export individual blocks? Date: Mon, 05 Mar 2012 08:24:46 -0700 Message-ID: <87wr6zax0z.fsf@gmx.com> References: <87pqctkahb.fsf@gmx.com> <87ty25hbz6.fsf@med.uni-goettingen.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S4aPE-0000f9-ML for emacs-orgmode@gnu.org; Mon, 05 Mar 2012 11:05:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S4aP8-0003vO-19 for emacs-orgmode@gnu.org; Mon, 05 Mar 2012 11:05:00 -0500 Received: from mailout-us.gmx.com ([74.208.5.67]:32788) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1S4aP7-0003v5-Q4 for emacs-orgmode@gnu.org; Mon, 05 Mar 2012 11:04:53 -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 Andreas Leha writes: > Eric Schulte writes: > >> Leo Alekseyev writes: >> >>> I was wondering if there was an easy way to execute some shell >>> commands contained in a src block as root. Alternatively, is there a >>> quick way to export _just_ that one source block to a temp file so >>> that I could run it as root manually? >>> >> >> Just call org-babel-tangle with a prefix argument and it only tangles >> the current block >> >>> > > Hi, > > I did not know this either. Thanks for the hint! > > Shouldn't this be mentioned in the manual (14.4)? > > I have two questions/issues about this: > (1) Can I get noweb-references to be expanded by this? Or how would I > tangle one block with noweb references expanded? There was a conflict between the narrowing to a single code block caused by the prefix argument, and the code which searches for replacements to noweb elements. I've just pushed up a fix so noweb elements should now expand as normal. > > (2) I am asked for a filename. But the header argument :tangle somefile > is overruling my input, which is un-expected. > This is now fixed as well. Thanks, > > Regards, > Andreas > > -- Eric Schulte http://cs.unm.edu/~eschulte/