标签:blog io sp div on log bs as tt
# !/bin/bash rc=$1 exe=$2 if [ ! -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
标签:blog io sp div on log bs as tt
原文地址:http://www.cnblogs.com/kangbry/p/4089241.html