Re: Re: [hackers] [surf] Simplify DOWNLOAD macro || Quentin Rameau

From: Ivan Tham <pickfire_AT_riseup.net>
Date: Thu, 11 May 2017 09:57:42 +0800

ssd_AT_mailless.org wrote:

> Hi,
>
> I chime in again:
>
> I think it's definitely the right thing to make it interactive, rather than
> sleep.
>
> I found it very beneficial to go a step further: rather than just asking for
> confirmation with `read`, I drop the user in a shell, after the download is
> complete. They see what file was downloaded, a `pwd` gives them even more
> context and they can right away do whatever they intended with the downloaded
> file.
>
> Here is what I found in my config:
>
> #define DOWNLOAD(d) { \
> .v = (char *[]){ "/bin/sh", "-c", \
> "st -e sh -c \"wget " \
> "--user-agent '$1' " \
> "--no-check-certificate --load-cookies ~/.surf/cookies.txt '$0'; " \
> "pwd; exec ${SHELL}\"", d, useragent, NULL } }
>
> cheers
> --s

I prefer it to close automatically after a timeout AND interactively with:

    timeout 5 read
Received on Thu May 11 2017 - 03:57:42 CEST

This archive was generated by hypermail 2.3.0 : Thu May 11 2017 - 04:03:05 CEST