#!/bin/bash ver=`cat gate.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}‘` 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=gate seek=5 cbs=1 obs=1 conv=notrunc bs=4 rm test
原文地址:http://www.cnblogs.com/kangbry/p/3849400.html