[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: |
Sébastien Vauban |
Subject: |
[Orgmode] Re: [babel] Sh problem when echo'ing input data with ' inside |
Date: |
Tue, 18 Jan 2011 10:22:05 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (windows-nt) |
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'op.ration;Devise;Date d'op.ration;Compte de contrepartie;Nom de la
>> contrepartie :;Communication 1 :;Communication 2 :
>> 04-06-2009;A9F04NT01WK300TG;Virem.
>> internet;420,00;EUR;04-06-2009;799-5900947-23;PAYEE ONE; ;
>> 24-02-2009;A9B24NT012K4018Z;Virem.
>> internet;-54,93;EUR;24-02-2009;799-9974005-30;ME;Eigen rekening;
>> 18-05-2008;A8E19NT000S604QI;Virem.
>> internet;-1.000,00;EUR;19-05-2008;799-8068445-18;PAYEE TWO; ;
>> BABEL_STRING
>> )
>> echo "$data"
>> #+end_src
>>
>> That is no indentation and the here-tag should be in quotes (otherwise the
>> here-script is subject to shell expansion).
>
> The above, from which I even removed the accentuated characters (from French),
> still does not work...
>
> 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 Windows, then.
>
> - Has anyone any experience with this?
> - Can some Bash user confirm what I see?
> - Can some Windows user confirm this with other Unix-emulation shells (MinGW
> and the like)?
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?
Best regards,
Seb
--
Sébastien Vauban