Samuel Wales <samolog...@gmail.com> 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