Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

Using md5sum to name file based on URL

Shell Programming and Scripting


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 12-03-2011
The undertaker The undertaker is offline
Registered User
 
Join Date: Dec 2011
Last Activity: 4 December 2011, 4:45 PM EST
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Using md5sum to name file based on URL

I am trying to download a file and make the filename of the file be the md5sum of the URL. I know to use wgets to download the file but I do not know how to do the rest...any help would be appreciated.
Sponsored Links
    #2  
Old Unix and Linux 12-03-2011
Scott's Unix or Linux Image
Scott Scott is offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 29 June 2015, 1:20 PM EDT
Location: Zürich
Posts: 8,568
Thanks: 337
Thanked 1,080 Times in 938 Posts
OK, I have neither wget or md5sum, only curl and md5 Linux

Looking at the man page for wget, it might go something like:

Code:
$ X="http://scrivener.s3.amazonaws.com/Scrivener.dmg"
$ wget $X -O $(echo $X | md5sum)

But, check the man page Linux
Sponsored Links
    #3  
Old Unix and Linux 12-03-2011
The undertaker The undertaker is offline
Registered User
 
Join Date: Dec 2011
Last Activity: 4 December 2011, 4:45 PM EST
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Thank you so much for your help.
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script to check MD5SUM on file tb1986 Shell Programming and Scripting 0 10-16-2010 07:47 PM
Duplicate file remover using md5sum--good enough? Michael Stora Shell Programming and Scripting 2 08-31-2010 02:48 AM
Restart script based on MD5sum Bakes Shell Programming and Scripting 6 01-02-2009 10:32 AM
the file: MD5SUM samprax UNIX for Dummies Questions & Answers 1 07-05-2002 03:30 AM
What is md5sum??? solvman UNIX for Dummies Questions & Answers 1 09-25-2001 12:31 PM



All times are GMT -4. The time now is 05:10 PM.