Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to use the @sha1 function in a tcc.exe command line?

Jul
30
0
I'm new to tcc.exe and am trying to download and run vim
so I can edit batch files.

Before running vim it is necessary to use the @sha1 function
to make sure my download is correct.

I'd like to use a command line like:
c:\users\lba\downloads %[[@sha1] vim73-x64.zip]
to use the @sha1 function to display the sha1 variable.

It's not working so that means I'm not using the syntax properly.

Could anyone tell me the proper syntax?

Larry Alkoff
 
I'm new to tcc.exe and am trying to download and run vim
so I can edit batch files.

Before running vim it is necessary to use the @sha1 function
to make sure my download is correct.

I'd like to use a command line like:
c:\users\lba\downloads %[[@sha1] vim73-x64.zip]
to use the @sha1 function to display the sha1 variable.

It's not working so that means I'm not using the syntax properly.

Could anyone tell me the proper syntax?

You can use functions like @SHA1 in any command, even an external command. If you just want to see the checksum, then ECHO would be an appropriate command:

Code:
echo %@sha1[c:\users\lba\downloads\vim73-x64.zip]
 
You can use functions like @SHA1 in any command, even an external command. If you just want to see the checksum, then ECHO would be an appropriate command:

Code:
echo %@sha1[c:\users\lba\downloads\vim73-x64.zip]

Thank you very much Charles.
This will apply to any function, so now I know how to handle functions

Larry
 
This is a batch file I call sha1bat.btm. It lets me pick the file I
want the sum computed on, and compares it to a text file that already
has that value computed so I can compare.

echo filename and hash are on same line
setlocal
: bdebugger
set filespec=%@getfile[.]

: you will need to be in the same folder as this file
:: assuming from your post the filename and hashvalue are on the
same line
:: word0 will be the iso filename, word1 will be the hash value

do r=0 to %@lines[%filespec]
set aline=%@line[%filespec,%r]
set sha1hash=%@sha1[%@word[0,%aline]]
IFF %sha1hash EQ %@word[1,%aline] THEN
echo Matched
ELSE
echo Not Matched
ENDIFF
enddo
endlocal

On 12/11/2010 06:40 PM, larryalk wrote:

> ---Quote (Originally by Charles Dye)---
> You can use functions like @SHA1 in any command, even an external command. If you just want to see the checksum, then ECHO would be an appropriate command:
>
>
> Code:
> ---------
> echo %@sha1[c:\users\lba\downloads\vim73-x64.zip]
> ---------
> ---End Quote---
> Thank you very much Charles.
> This will apply to any function, so now I know how to handle functions
>
> Larry
>
>
>
>
>
 
This is a batch file I call sha1bat.btm. It lets me pick the file I
want the sum computed on, and compares it to a text file that already
has that value computed so I can compare.

echo filename and hash are on same line
setlocal
: bdebugger
set filespec=%@getfile[.]

: you will need to be in the same folder as this file
:: assuming from your post the filename and hashvalue are on the
same line
:: word0 will be the iso filename, word1 will be the hash value

do r=0 to %@lines[%filespec]
set aline=%@line[%filespec,%r]
set sha1hash=%@sha1[%@word[0,%aline]]
IFF %sha1hash EQ %@word[1,%aline] THEN
echo Matched
ELSE
echo Not Matched
ENDIFF
enddo
endlocal

On 12/11/2010 06:40 PM, larryalk wrote:

Thanks for the batch file drrob1.
I'm probably going to have to go over my old batch files
from 10-15 years ago when I used Windows and 4NT
and can use yours as a model.

Larry
 

Similar threads

Back
Top