Thread: BATCH
View Single Post
  #1 (permalink)  
Old May 1st, 2006, 08:47 PM
scapermoya scapermoya is offline
Registered User
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default BATCH

I am writing a little batch file to check something for me, and I have run into a problem. This is likely just a limitation of batch files in general, but lets see if you guys can find a way around it.

Basically, I want to set a variable as the stdout of another command.

my batch file does the following:
it uses curl to download an html file, and then gets the md5 hash of that file and spits it into a text file. essentially, I need to set a variable to that spat out hash (e.g. SET hash=`cat hash.txt`), but it doesnt seem like batch files, or the windows command line in general, are able to execute programs within a line.

Is there a way to get that hash to either be a variable within this batch file, or to get it to be the stdin for another batch file (so that I could just use %1 to designate the hash).

Im trying to find when the webpage changes, so I have a hash of what the html file is now, and I want to compare it to what curl downloads every 15 minutes. If you can think of a better way to do this, let me know.

Reply With Quote