emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [babel] shell does not unquote


From: Eric Schulte
Subject: Re: [O] [babel] shell does not unquote
Date: Thu, 06 Feb 2014 13:12:47 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Samuel Wales <address@hidden> writes:

> hi eric,
>
> say you want to list 2 files: "1 space" and "nospace".
>
> #+call: list(how="\"1 space\" nospace")
>
> #+name: list
> #+BEGIN_SRC sh :noweb yes :results verbatim output
>   {
>       # this fails
>       # ls $how
>       # this would work, if there were a call option to support it
>       # ls <<how>>
>   } 2>&1
>   :
> #+END_SRC
>
> is there?

You can't mix noweb and variable calling.  You could pass the files in
using either of the following techniques.

#+name: files-tab
| with space |
| nospace    |

#+name: files-ex
: with space
: nospace

#+name: list
#+begin_src sh :var files="" :results verbatim
IFS="
"
for file in $files;do
  echo "-|$file|-"
done
#+end_src

#+call: list(files-tab)

#+RESULTS:
: -|with space|-
: -|nospace|-

#+call: list(files-ex)

#+RESULTS:
: -|with space|-
: -|nospace|-

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D



reply via email to

[Prev in Thread] Current Thread [Next in Thread]