#!/bin/sh
cp $1 backup.ini
function pre_process()
{
echo "1. pre_process";
#Remove line with '#' beginning
sed -i '/^\#/d' backup.ini
#Remove space line
grep -v "^$" backup.ini > tmp.ini
mv tmp.ini backup.ini
#Remove the beginning four charactor
sed -r 's/.{4}//' backup.ini > tmp.ini
}
# input str
# return line num of first cuured input str
function process_burst_reg0()
{
#Find matched line for specified charactor
echo 'Finding page pos of burst reg';
echo $1
local a=1
while read line
do
if [[ $line =~ $1 ]]
then
echo "${a}"
break;
else
((a++));
fi
done < tmp.ini
return ${a};
}
function process_burst_reg1()
{
process_burst_reg0 '00 29';
local a=$?;
echo "return $a";
}
pre_process;
process_burst_reg1;
exit 0;