SCIENTIFIC-LINUX-USERS Archives

July 2014

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
David Sommerseth <[log in to unmask]>
Reply To:
Date:
Tue, 29 Jul 2014 19:40:17 +0200
Content-Type:
text/plain
Parts/Attachments:
text/plain (43 lines)
On 29/07/14 19:04, ToddAndMargo wrote:
> Hi All,
> 
> I am trying to extract the file name (for the revision)
> of a file with "--content-disposition".  I don't actually
> want the file.
> 
> Is there a way to have wget tell me the name of the file
> without actually downloading it?
> 
> Many thanks,
> -T
> 
> This is what I have so far.  Tell me the file exists
> but not its name.
> 
> 
>  wget --spider --content-disposition
> "http://www.overlooksoft.com/packages/download?plat=lx64&ext=rpm"
> 
> Spider mode enabled. Check if remote file exists.
> --2014-07-29 10:00:38--
> http://www.overlooksoft.com/packages/download?plat=lx64&ext=rpm
> 
> Resolving www.overlooksoft.com... 96.127.149.74
> Connecting to www.overlooksoft.com|96.127.149.74|:80... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: 6737765 (6.4M) [application/x-rpm]
> 
> Remote file exists.

$ curl -I 'http://www.overlooksoft.com/packages/download?plat=lx64&ext=rpm' \
   | awk -F= '/Content-Disposition: attachment;/ {print $2}'

Not sure if wget got a similar feature.  I just happen to like curl
slightly better.


--
kind regards,

David Sommerseth

ATOM RSS1 RSS2