Achim Gratz <strom...@nexgo.de> writes: > Sébastien Vauban <wxhgmqzgw...@spammotel.com> > writes: >> However, I can't do any work on the input file, the very basic echo command >> already giving an error: > > This is because quoting the arguments to echo does not work when your > input contains unescaped quote characters. I've no idea how exactly > babel tries to get it's arguments to the command, but it looks like it > simply copies text and executes the resulting script? If it could open > a pipe and send the data through, no quoting would be necessary since > the shell never sees the data. I'm not sure if that's possible because > I can't find specific documentation on language "sh". > > [Note: orgmode online manual links to > http://orgmode.org/worg/org-contrib/babel/languages/ which is broken.] >
yes, the Worg documentation is in dire need of maintenance, see below for discussion of how arguments are passed in the sh blocks > >> #+begin_src sh :var data=excel-from-bank :results output >> echo "$data" >> #+end_src > > So, you're using a un*xoid? This is your lucky day, since in your case you > should be able to use a here script: > > #+begin_src sh :var data=excel-from-bank :results output > echo <<EOF | cmd1 | cmd2 > $data > EOF > #+end_src > here scripts are how Babel sends data through to a shell script, as far as I know they should have no issues with quotes (or any other character) specifically, the following code block #+results: something #+begin_example something and something else with apostrophes ' and quotes " this should all work... #+end_example #+begin_src sh :var data=something echo $data #+end_src Expands to #+begin_src sh data=$(cat <<BABEL_STRING something and something else with apostrophes ' and quotes " this should all work... BABEL_STRING ) echo $data #+end_src Cheers -- Eric _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode