usage="$(basename"$0") [-v] [-q] n src des -- verifies per sha256sum of n(>=2) equidistant distributed blocks of size 4096kB, that src was correctly written to des
$(basename"$0") -h
where:
-v verbose: prints the sha256sums
-q quite: suppresses the output of the result,
the return-Code remains as reponse
-h prints this help message"
quite=false;
verbose=false;
printHelp=false;
for opt in"$@"
do
case$optin
-v)verbose=true;shift 1 ;;
-q)quite=true;shift 1 ;;
-h)printHelp=true;shift 1 ;;
-?)printHelp=true;shift 1 ;;
esac
done
if["$printHelp"=true]||[$# -ne 3 ]||[$1-le 1 ]
then
echo"$usage";
exit-1;
fi
n=$1
src=$2;
des=$3;
lengthSrc=$(($(stat-c'%s'$src)/4096));# length of the source (in 4096kB)
if["$verbose"=true]
then
echo"length of the source (in 4096kB): $lengthSrc"