Skip to content

Instantly share code, notes, and snippets.

@LordShedy
Created July 18, 2019 07:23
Show Gist options
  • Save LordShedy/aaa1935c9dbe6f6c2a3fb4e522a7825e to your computer and use it in GitHub Desktop.
Save LordShedy/aaa1935c9dbe6f6c2a3fb4e522a7825e to your computer and use it in GitHub Desktop.
Checking content of a file
#!/bin/bash
if [[ "$#" -lt 0 ]]
then
echo "Too little arguments, this script need some files to check!"
exit 0
fi
for i in "$@"
do
if [[ -e "$i" ]]
then
shasum=`tr -d "[:space:]" < $i | shasum | cut -d " " -f 1`
printf "$shasum is SHA1 checksum of the content of $i\n"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment