字體:小 中 大 |
|
|
|
| 2020/02/27 15:03:13瀏覽40|回應0|推薦0 | |
#!/bin/bash
# sh for chcecking .iso and .iso.md5
#assume, there are
# a.iso b.iso c.iso
# a.iso.md5 b.iso.md5 c.iso.md5
if [ -f "tmp.txt" ]; then
rm tmp.txt
fi
ls -l | grep iso.md5 > tmp.txt
#---
while read st1
do
st_filename_md5=`echo $st1 | awk '{print $NF}'`
st3=`cat $st_filename_md5`
st_filename_iso=`echo $st3 | awk '{print $2}'`
echo "calculate md5 of $st_filename_iso"
st_result_md5=`md5sum $st_filename_iso`
if [ "$st_result_md5" == "$st3" ]; then
echo "OK"
else
echo "!!! ERROR !!!"
exit
fi
done < tmp.txt
echo "done"
|
|
| ( 知識學習|語言 ) |










