[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 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 bas

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

2011-01-20 Thread Achim Gratz
Sébastien Vauban 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 didn't see it on Linux).

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

2011-01-18 Thread Achim Gratz
Sébastien Vauban 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 the data coming from ema

[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 >> ` >> echo "$data" >> #+end_src >> >> and.

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 > ` > echo "$data" > #+end_src > > and... it indeed works! > > Can we move to that syn

[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 >> l'

[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 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 gener

[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 a

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

2011-01-17 Thread Achim Gratz
Sébastien Vauban 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 blocks from Org... under Wi

[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

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

2011-01-17 Thread Achim Gratz
Achim Gratz writes: > #+begin_src sh :var data=excel-from-bank :results output > echo < $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 <+ Wavetables for the Terratec KOMPLEXER: http://Synt

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

2011-01-17 Thread Eric Schulte
Achim Gratz writes: > Sébastien Vauban > 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 exa

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

2011-01-17 Thread Achim Gratz
Sébastien Vauban 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 argu

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

[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 (=ec