Created
July 18, 2019 07:23
-
-
Save LordShedy/aaa1935c9dbe6f6c2a3fb4e522a7825e to your computer and use it in GitHub Desktop.
Checking content of a file
This file contains hidden or 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 | |
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