If I try to print integers that are 6 or less digits long everything works perfect:
Example
for i in $(seq 123450 123451); do printf "%7.0f\n" $i; done
123450
123451
However, when integers are 7 or more digits long the last digit of the number is being output as ‘0’:
Example
for i in $(seq 1234560 1234561); do printf "%7.0f\n" $i; done
1234560
1234560
Question: what problem do I encounter and what should I do to be able to use “long” integers?
By default,
seqprints its output in %g format:so use
seq -f "%7.0f"instead:or just
seq -f "%.0f":