[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside
From: |
Achim Gratz |
Subject: |
[Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside |
Date: |
Mon, 17 Jan 2011 21:00:37 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
Sébastien Vauban <address@hidden>
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.]
> #+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
HTH,
Achim.
--
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+
SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada
- [Orgmode] [babel] Sh problem when echo'ing input data with ' inside, Sébastien Vauban, 2011/01/17
- [Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside,
Achim Gratz <=
- Re: [Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside, Eric Schulte, 2011/01/17
- [Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside, Achim Gratz, 2011/01/17
- [Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside, Sébastien Vauban, 2011/01/18
- Re: [Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside, Eric Schulte, 2011/01/18
- [Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside, Sébastien Vauban, 2011/01/18
- [Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside, Achim Gratz, 2011/01/18
- [Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside, Achim Gratz, 2011/01/20