[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 19:13:31 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Samuel Wales <address@hidden> writes:
> thanks for the examples, but they don't meet my needs as tables for
> each set of arguments would be too unwieldy.
>
How about this.
#+name: list
#+begin_src sh :var files="" :results verbatim
IFS="
"
for file in $files;do
echo "-|$file|-"
done
#+end_src
#+call: list("1 space\nnospace")
#+RESULTS:
: -|1 space|-
: -|nospace|-
>
> what would be ideal is to allow setting noweb expansions in the call
> line (instead of requiring named blocks to provide the expansion).
> i.e. it is similar to setting a var, but is a noweb setting instead.
>
> then i would just do the call with the files i want, quoted the way i want.
>
> may i make this a feature request?
>
I'm not sure that the additional utility justifies the added complexity.
Best,
>
>
> On 2/6/14, Eric Schulte <address@hidden> wrote:
>> #+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