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

2014-02-09 Thread Eric Schulte
Samuel Wales writes: > hi eric, > > the object is to make the code inside a babel shell block as similar > to a real shell script as possible. also, calling it using #+call > should be like calling it from another shell script. > > this isn't possible in babel at present. > > the script cannot u

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

2014-02-08 Thread Samuel Wales
hi eric, the object is to make the code inside a babel shell block as similar to a real shell script as possible. also, calling it using #+call should be like calling it from another shell script. this isn't possible in babel at present. the script cannot use "$@" for its positional parameters.

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

2014-02-06 Thread Eric Schulte
Samuel Wales 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("

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

2014-02-06 Thread Samuel Wales
thanks for the examples, but they don't meet my needs as tables for each set of arguments would be too unwieldy. 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 now

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

2014-02-06 Thread Eric Schulte
Samuel Wales 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

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

2014-02-06 Thread Samuel Wales
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 <> } 2>&1

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

2014-02-05 Thread Eric Schulte
Use org-babel-expand-block (C-c C-v v) to view the code block with the variable expansion. Best, Samuel Wales writes: > i don't know why the shell does not unquote here: > > #+BEGIN_SRC sh :results verbatim output :var how="a 'b' \c \"d\" e" > :var dothis="echo \"hi\"" > echo $how >

[O] [babel] shell does not unquote

2014-02-04 Thread Samuel Wales
i don't know why the shell does not unquote here: #+BEGIN_SRC sh :results verbatim output :var how="a 'b' \c \"d\" e" :var dothis="echo \"hi\"" echo $how $dothis #+END_SRC #+RESULTS: #+begin_example a 'b' c "d" e "hi" #+end_example thanks. samuel -- The Kafka Pandemic: http://thek