From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stig Brautaset Subject: eval code snippet before tangling config file Date: Wed, 11 May 2016 13:34:27 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0TPB-0002gM-49 for emacs-orgmode@gnu.org; Wed, 11 May 2016 08:38:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0TP5-0005z2-RG for emacs-orgmode@gnu.org; Wed, 11 May 2016 08:38:19 -0400 Received: from plane.gmane.org ([80.91.229.3]:53590) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0TP5-0005yA-Gz for emacs-orgmode@gnu.org; Wed, 11 May 2016 08:38:15 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b0TP3-0006Pj-SK for emacs-orgmode@gnu.org; Wed, 11 May 2016 14:38:14 +0200 Received: from 185.59.181.102 ([185.59.181.102]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 May 2016 14:38:13 +0200 Received: from stig by 185.59.181.102 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 11 May 2016 14:38:13 +0200 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" To: emacs-orgmode@gnu.org Hi, I'm trying to evaluate a line of shell code and put its output into a snippet that will be tangled to a file. My best attempt so far: #+NAME: hostname #+BEGIN_SRC sh hostname -s #+END_SRC #+BEGIN_SRC conf :tangle /usr/local/etc/leafnode/config :noweb tangle expire = 20 server = news.gmane.org initialfetch = 100 hostname = <>.superloopy.io #+END_SRC However the result of that tangle includes the shell snippet in verbatim: #+RESULTS: : expire = 20 : server = news.gmane.org : initialfetch = 100 : hostname = hostname -s.superloopy.io I suspect this is because it will be executed in the context of "conf" mode, which does not really have an execution mode. Syntax highlighting etc works fine, however. I could change to make a shell script to write the config, but it's not as nice really. PS: this is an improvement to my existing setup of Leafnode on OS X, if anybody's interested: http://github.com/stig/dot-files/tree/master/Leafnode.org Stig