首页 > 代码库 > 修改版本号

修改版本号

# !/bin/bash   rc=$1exe=$2if [ ! -e "$rc" ]; then    echo "rc not exist"    exit fi if [ ! -e "$exe" ]; then    echo "exe not exist"    exit fi ver=`cat $rc | grep FILEVERSION` ver=`echo $ver | awk ‘{print $2;}‘`ver=`echo $ver |sed ‘s/\([0-9]*\),\([0-9]*\),\([0-9]*\),\([0-9]*\)/\1 \2 \3 \4/‘`v1=`echo $ver | awk ‘{print $1}‘`v2=`echo $ver | awk ‘{print $2}‘`v3=`echo $ver | awk ‘{print $3}‘`v4=`echo $ver | awk ‘{print $4}‘`version="$v1"".""$v2"".""$v3"".""$v4" version=${version%?}v1=`echo $v1 |awk ‘{printf("%x",$v1)}‘`v2=`echo $v2 |awk ‘{printf("%x",$v2)}‘`v3=`echo $v3 |awk ‘{printf("%x",$v3)}‘`v4=`echo $v4 |awk ‘{printf("%x",$v4)}‘` echo -e -n "\x$v4\x$v3\x$v2\x$v1">test dd if=test of=$exe seek=5 cbs=1 obs=1 conv=notrunc bs=4 rm test  sh pack.sh $3 $version  exit  

 

修改版本号