Re: reset number after each month
Posted by Roshan on May 17, 2017; 4:04pm
URL: http://erman-arslan-s-oracle-forum.124.s1.nabble.com/reset-number-after-each-month-tp2706p2713.html
Thanks for support
I have modified my script and it is working now
n=`cat fileread.txt`
echo $n
d=$(date "+%d%m%Y")
n=$(printf "%02d" "$((${n} + 1))")
f="outputSMS_${d}_${n}.unl"
echo $f
echo $n
sed_param=s/Var1=.*/Var1=${n}/
sed -i "$sed_param" fileread.txt
Can you please suggest what I can include in my if statement?
Another way I can reset $n to 1 is clear fileread.txt and echo Var1=00 >fileread.txt in a script. Then I can schedule it in crontab.