Last active
January 22, 2019 06:00
-
-
Save kumbasar/303b32d2aea5d635b3c1d5d544330d93 to your computer and use it in GitHub Desktop.
A script which generates the checksum files for the Artifactory
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 [ $# -eq 0 ] | |
then | |
echo "No file supplied." | |
echo "Example: ./checksum.sh wget_1.0.1_amd64.deb" | |
exit -1 | |
fi | |
declare -a checksum=("md5sum" "sha256sum" "sha1sum") | |
## now loop through the above array | |
for i in "${checksum[@]}" | |
do | |
echo "$i" | |
# or do whatever with individual element of the array | |
$i $1 | awk '{print $1}' | tee ${1}.${i::-3} | |
done |
Author
kumbasar
commented
Jan 22, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment