expand gcc case variable length

daniel@daniel-mint ~/vex $ bash gen.sh 0x10 0x1F
			case 10:
			case 11:
			case 12:
			case 13:
			case 14:
			case 15:
			case 16:
			case 17:
			case 18:
			case 19:
			case 1A:
			case 1B:
			case 1C:
			case 1D:
			case 1E:
			case 1F:
daniel@daniel-mint ~/vex $ cat gen.sh
lower=$(($1))
upper=$(($2))

it=$lower
while [ $it -le $upper ]
do
	printf "\t\t\tcase %2X:\n" $it
	let it=$it+1 
done

  

lower=$(($1))
upper=$(($2))

it=$lower
while [ $it -le $upper ]
do
	printf "\t\t\tcase %2X:\n" $it
	let it=$it+1 
done

  

posted @ 2014-06-17 13:50  Daniel King  阅读(168)  评论(0编辑  收藏  举报