From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [BABEL][BUG] Tangle incorrect with variables Date: Wed, 30 Mar 2011 14:17:30 -0600 Message-ID: <87y63wqs5h.fsf@gmail.com> References: <4D931E38.6000003@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=50394 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q51qC-0004FH-RY for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 16:18:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q51qB-0003vD-JD for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 16:18:08 -0400 Received: from mail-iy0-f169.google.com ([209.85.210.169]:62575) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q51qB-0003v6-Fo for emacs-orgmode@gnu.org; Wed, 30 Mar 2011 16:18:07 -0400 Received: by iyf13 with SMTP id 13so2122263iyf.0 for ; Wed, 30 Mar 2011 13:18:06 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rainer M Krug Cc: emacs-orgmode Hi Rainer, When I tangle this code block (just slightly reformatted for my own readability) #+headers: :var STATE=(vc-state (or (buffer-file-name) org-current-export-file)) #+headers: :var REV=(vc-working-revision (or (buffer-file-name) org-current-export-file)) #+begin_src sh :tangle yes rm -rf ./R rm -f ./spreadSim.sub REVISION=$REV.$STATE tar -xf nsa.$REVISION.tar.gz $HOME/R/R/R-2.12.0/bin/Rscript --vanilla -e "source('./R/generateLatinHypercubeScenarios.R'); doIt()" for SCENARIO in ./R/scenarios/*.R; do export SCENARIO=${SCENARIO#./R/scenarios/} qsub nsa.sub done #+end_src I get the following tangled output --8<---------------cut here---------------start------------->8--- REV=$(cat <<'BABEL_TABLE' master BABEL_TABLE ) STATE=$(cat <<'BABEL_TABLE' edited BABEL_TABLE ) rm -rf ./R rm -f ./spreadSim.sub REVISION=$REV.$STATE tar -xf nsa.$REVISION.tar.gz $HOME/R/R/R-2.12.0/bin/Rscript --vanilla -e "source('./R/generateLatinHypercubeScenarios.R'); doIt()" for SCENARIO in ./R/scenarios/*.R; do export SCENARIO=${SCENARIO#./R/scenarios/} qsub nsa.sub done --8<---------------cut here---------------end--------------->8--- Which looks right to me. Could it be something specific about your setup which is causing this issue? Cheers -- Eric Rainer M Krug writes: > Hi > > when I tangle this document, I get the results in the section below. > This is obviously not correct. This worked in an earlier version. > > Any help appreciated, > > Rainer > > > * Run script (./../nsa.sh) > :PROPERTIES: > :tangle: ./nsa.sh > :exports: code > :END: > ** Update and call submit script > :PROPERTIES: > :ID: 173c527a-b032-4cc5-89d8-a32c3c0c7cae > :END: > #+BEGIN_SRC sh :var REV=(vc-working-revision (or (buffer-file-name) > org-current-export-file)) :var STATE=(vc-state (or (buffer-file-name) > org-current-export-file)) > rm -rf ./R > rm -f ./spreadSim.sub > REVISION=$REV.$STATE > tar -xf nsa.$REVISION.tar.gz > $HOME/R/R/R-2.12.0/bin/Rscript --vanilla -e > "source('./R/generateLatinHypercubeScenarios.R'); doIt()" > for SCENARIO in ./R/scenarios/*.R; do > export SCENARIO=${SCENARIO#./R/scenarios/} > qsub nsa.sub > done > #+END_SRC > > * tangled > #+begin_example > #!/bin/bash > REV=$(cat <<'BABEL_TABLE' > > BABEL_TABLE > ) > STATE=$(cat <<'BABEL_TABLE' > > BABEL_TABLE > ) > rm -rf ./R > rm -f ./spreadSim.sub > REVISION=$REV.$STATE > tar -xf nsa.$REVISION.tar.gz > $HOME/R/R/R-2.12.0/bin/Rscript --vanilla -e > "source('./R/generateLatinHypercubeScenarios.R'); doIt()" > for SCENARIO in ./R/scenarios/*.R; do > export SCENARIO=${SCENARIO#./R/scenarios/} > qsub nsa.sub > done > #+end_example