Skip to content

Instantly share code, notes, and snippets.

@s3cpat
Created February 18, 2018 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s3cpat/76c4c82b3b9280a4e39c85b16d4a874f to your computer and use it in GitHub Desktop.
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
#!/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