Created
February 18, 2018 21:30
-
-
Save s3cpat/76c4c82b3b9280a4e39c85b16d4a874f to your computer and use it in GitHub Desktop.
Quick bash script to generate checksums of a file passed as an argument
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# generate checksums for files passed as arguments | |
# $'\r' included to provide windows line breaks :) | |
infile=$1 | |
out=$infile.sums.txt | |
echo "" > $out | |
echo "MD5:" | tee -a $out && md5sum $infile | tee -a $out | |
echo $'\r' | tee -a $out | |
echo "SHA-1:" | tee -a $out && sha1sum $infile | tee -a $out | |
echo $'\r' | tee -a $out | |
echo "SHA-256:" | tee -a $out && sha256sum $infile | tee -a $out | |
echo "done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment