[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lynx-dev] Downloading files whose names contain spaces
From: |
Graham Lawrence |
Subject: |
Re: [Lynx-dev] Downloading files whose names contain spaces |
Date: |
Sat, 5 Oct 2013 13:29:53 -0700 |
Many thanks, Tim. In lynx.cfg, I uncommented 3 lines and downloading
with wget works like a charm, actually much more convenient than thru
lynx. Except for sites that I have to log on to, they block wget, so
I also had to write a little script to give me a good filename to
download thru lynx.
In lynx.cfg I activated these lines:
KEYMAP:,:EXTERN_PAGE # Run external program with current page
KEYMAP:.:EXTERN_LINK # Run external program with current link
EXTERNAL:http:wget %s &:TRUE
and this bash script:
sfx=${1-"torrent"} # $1 defaults to torrent
a=$(xsel) # xsel manipulates content of the various clipboards
a=${a//[^A-Za-z0-9 ]/} # keep only letters digits and spaces from selection
x=(${a,,}) # lowercase it into an array
address@hidden # capitalize each item in array and store back in variable
xsel -i <<< ${a// /}.$sfx # remove spaces, add suffix and store
on middle mouse clipboard
On 9/30/13, Graham Lawrence <address@hidden> wrote:
> Thank you, Karen and Thomas, for your input; and I will follow up on
> your suggestions, Tim, regarding wget and lynx.cfg. If all else
> fails, I can perhaps write a script for it.
>
> On 9/28/13, Tim Chase <address@hidden> wrote:
>>> On Sat, 28 Sep 2013, Graham Lawrence wrote:
>>> > If I wish to download a file whose name contains spaces, Lynx
>>> > presents a suggested name for the file consisting only of the
>>> > first word of its name. Is there any convenient way to have Lynx
>>> > present the entire name instead?
>>
>> You might be able to use the EXTERN_LINK command (by default, I
>> think this is bound to the period) to launch something like "wget" on
>> the URL which might preserve the entire filename. By default, my
>> /etc/lynx.cfg has entries that include launching wget to pull down
>> files. I haven't tested it on anything with a space in the name, but
>> from what I see in the file, I'm not sure whether the "%s" needs to
>> be wrapped in double-quotes to prevent the shell from treating the
>> space-separated bits as separate parameters.
>>
>> -Tim
>>
>>
>>
>>
>>
>
>
> --
> Graham Lawrence
>
--
Graham Lawrence
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Lynx-dev] Downloading files whose names contain spaces,
Graham Lawrence <=