[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] How to let ob-shell to download file and get result as a link to
From: |
Michael Welle |
Subject: |
Re: [O] How to let ob-shell to download file and get result as a link to file? |
Date: |
Mon, 26 Mar 2018 20:06:21 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3.50 (gnu/linux) |
Hello,
stardiviner <address@hidden> writes:
> I tried the following example:
>
> ```
>
> #+begin_src shell :mkdir yes :dir "data/tmp" :results file :file
> "crackzor_1.0.c.gz"
> wget -c "http://ben.akrin.com/crackzor/crackzor_1.0.c.gz"
> #+end_src
>
> #+RESULTS:
> [[file:data/tmp/crackzor_1.0.c.gz]]
> ```
>
> But the files is empty, I check out Org-mode document about `:file`
> header argument, seems org-babel will write result to `:file` specified
> file. I wander how I can handle upper case correctly? (don't write
> result to file, just insert a link to downloaded file as a result)
well, your above example would work, at least to a certain point, if you
let wget write its output to stdout:
#+begin_src sh :mkdir yes :dir "/tmp" :results file :file "crackzor_1.0.c.gz"
wget -c "http://ben.akrin.com/crackzor/crackzor_1.0.c.gz" -O-
#+end_src
But I don't now know how to get the encoding right (I think that's the
problem). The zip file contains rubbish. What I would do instead is
something like this:
#+begin_src sh :mkdir yes :dir "/tmp" :results raw :var fn="crackzor_1.0.c.gz"
/usr/bin/wget -c "http://ben.akrin.com/crackzor/${fn}"
echo "[[file:/tmp/${fn}]]"
#+end_src
Regards
hmw
- [O] How to let ob-shell to download file and get result as a link to file?, stardiviner, 2018/03/26
- Re: [O] How to let ob-shell to download file and get result as a link to file?,
Michael Welle <=
- [O] [PATCH] support insert link without write result to :file link, stardiviner, 2018/03/26
- Re: [O] [PATCH] support insert link without write result to :file link, Nicolas Goaziou, 2018/03/27
- Re: [O] [PATCH] support insert link without write result to :file link, stardiviner, 2018/03/28
- Re: [O] [PATCH] support insert link without write result to :file link, Nicolas Goaziou, 2018/03/28
- Re: [O] [PATCH] support insert link without write result to :file link, stardiviner, 2018/03/28
- Re: [O] [PATCH] support insert link without write result to :file link, Berry, Charles, 2018/03/29