I am developing a shell script that executes a command a returns a checksum string. This string is has each hexa separated with white spaces, something that I would like to remove and have, for example, 4AA512, instead of 4A A5 12 as command output but I am not able to find a solution that works. Here the script:
for /f "delims=" %%f in ('dir %~dp0*.zip /b') do (
echo %%~f:
for /f "delims=" %%a in ('certUtil -hashfile "%~dp0%%~f" SHA512 ^| find /i /v "SHA512" ^| find /i /v "certUtil"^') do (
echo %%a:' '=''%
)
set /a counter += 1
echo.
)
Anyone has a solution?
Thanks!
(answer moved from question/comment to - well - an answer)
Finally got a solution:
set counter=0
for /f "delims=" %%f in ('dir %~dp0*.zip /b') do (
echo %%~f:
for /f "delims=" %%a in ('certUtil -hashfile "%~dp0%%~f" SHA512 ^| find /i /v "SHA512" ^| find /i /v "certUtil"^') do (call :ShowChecksum "%%a")
set /a counter += 1
echo.
)
echo %counter% files(s) found.
pause
exit
:ShowChecksum
set "checksum=%~1"
set "checksum=%checksum: =%"
echo %checksum%