#!/bin/bashf1="$1*"f2="$2*"echo "第一个版本:"$f1echo "第二个版本:"$f2git log | grep "commit [0-9a-zA-Z]\{40\}"|awk 'BEGIN{count=0;} {commit[count]=$2;count++;} END{for(i=0;iresultLineNum=`awk 'END {print NR}' ./result`if [ $LineNum -lt 2 ];thenecho "版本号输入错误,请检查输入的版本号"elsenum=`awk 'BEGIN{count=0;} {num[count]=$1;count++;} END{print sqrt((num[0]-num[1])*(num[0]-num[1]))+1}' ./result`echo "相差"$num"个版本"fi