I have a simple query
If we have BATCH= 081675
and incremnting it by one as
BATCH=`expr ${BATCH} + 000001`;
We can't get BATCH = 081676
but gets BATCH = 81676
Can anyone tell why i am getting this value and not the rquired one and how i could get the required one?
Because you are operating with integers, not with strings.
I suggest you to perform all the computations with integers and, only at the end, pad the result with the required zeroes (in this case, 6 zeroes):
BATCH=081675
BATCH=`expr ${BATCH} + 1`
BATCH=`printf "%06d\n" "$BATCH"`
echo "$BATCH"