[Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside

2011-01-20 Thread Achim Gratz
Sébastien Vauban wxhgmqzgw...@spammotel.com writes: I asked the question on the Cygwin mailing list, and got an answer from Tobias Schlottke, telling me to use the 'plain old' syntax (=`...`= instead of =$(...)=): On further investigation, this is a bug in bash3, fixed in bash4 (hence why I

[Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside

2011-01-20 Thread Sébastien Vauban
Hi Achim, Achim Gratz wrote: Sébastien Vauban wxhgmqzgw...@spammotel.com writes: I asked the question on the Cygwin mailing list, and got an answer from Tobias Schlottke, telling me to use the 'plain old' syntax (=`...`= instead of =$(...)=): On further investigation, this is a bug in

[Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside

2011-01-18 Thread Sébastien Vauban
Hi Eric and Achim, Sébastien Vauban wrote: Achim Gratz wrote: The script produced by babel should actually look like this: #+begin_src sh data=$(cat 'BABEL_STRING' Num.ro du compte :;979-9500975-24;Compte Maxi Date valeur;R.f.rence de l'op.ration;Description;Montant de

Re: [Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside

2011-01-18 Thread Eric Schulte
I asked the question on the Cygwin mailing list, and got an answer from Tobias Schlottke, telling me to use the 'plain old' syntax (=`...`= instead of =$(...)=): #+begin_src sh data=`cat EOF ... EOF ` echo $data #+end_src and... it indeed works! Can we move to that syntax? I just

[Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside

2011-01-18 Thread Sébastien Vauban
Hi Eric, Eric Schulte wrote: I asked the question on the Cygwin mailing list, and got an answer from Tobias Schlottke, telling me to use the 'plain old' syntax (=`...`= instead of =$(...)=): #+begin_src sh data=`cat EOF ... EOF ` echo $data #+end_src and... it indeed works! Can

[Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside

2011-01-18 Thread Achim Gratz
Sébastien Vauban wxhgmqzgw...@spammotel.com writes: I asked the question on the Cygwin mailing list, and got an answer from Tobias Schlottke, telling me to use the 'plain old' syntax (=`...`= instead of =$(...)=): I can confirm. This is really bad, since now you'd have to escape backticks in

[Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside

2011-01-17 Thread Sébastien Vauban
Hi Eric, Eric Schulte wrote: I tried to work on a CSV2Ledger, accepting the particular (European) CSV format of my bank: * Europeanize the CSV file Here, we have to make several manipulations on the input file [...]. My goal is to make that as a suite of bash commands (=echo | cmd 1 | cmd

Re: [Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside

2011-01-17 Thread Eric Schulte
and the sh code block expands to the following (with C-c C-v v) which is not affected by commas... I've no trouble with commas, except that it's not an American formatting for amounts. Though, I does well have problems, as showed, with the apostrophe... Sorry, I mis-typed, as far as I can

[Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside

2011-01-17 Thread Achim Gratz
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

Re: [Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside

2011-01-17 Thread Eric Schulte
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

[Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside

2011-01-17 Thread Achim Gratz
Achim Gratz strom...@nexgo.de writes: #+begin_src sh :var data=excel-from-bank :results output echo EOF | cmd1 | cmd2 $data EOF #+end_src Sent too soon: use cat, not echo. Actually that is redundant, too: #+begin_src sh :var data=excel-from-bank :results output cmd1 EOF | cmd2 $data EOF

[Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside

2011-01-17 Thread Sébastien Vauban
Hi Achim and Eric, Achim Gratz wrote: The script produced by babel should actually look like this: #+begin_src sh data=$(cat 'BABEL_STRING' Num.ro du compte :;979-9500975-24;Compte Maxi Date valeur;R.f.rence de l'op.ration;Description;Montant de l'op.ration;Devise;Date d'op.ration;Compte

[Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside

2011-01-17 Thread Achim Gratz
Sébastien Vauban wxhgmqzgw...@spammotel.com writes: The above, from which I even removed the accentuated characters (from French), still does not work... That's strange. Now, I can imagine it is due to Cygwin, not to Emacs/Org/Babel. Though, that's a problem in general for the use of sh

[Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside

2011-01-17 Thread Sébastien Vauban
Eric, Eric Schulte wrote: if you execute the previewed code block as an independent shell script on your machine does it throw errors or does it echo correctly? On this one: the behavior seen from Org Babel is the same as the one seen when saving the previewed script as an executable file and

[Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside

2011-01-17 Thread Sébastien Vauban
Hi Achim, Achim Gratz wrote: Sébastien Vauban wxhgmqzgw...@spammotel.com writes: The above, from which I even removed the accentuated characters (from French), still does not work... That's strange. Now, I can imagine it is due to Cygwin, not to Emacs/Org/Babel. Though, that's a