How can I generate a number start with 1 and only has 10 digit bash script

How can I generate all the numbers that start with 1 and have 10 digits?

For example: start with: 1000000000 ... end with: 1999999999

And how to save the result in a text file?


Your question is unclear.

If you're looking to generate a random(-ish) number:

num=1
for i in {1..9}; do num+=$((RANDOM % 10)); done
echo "$num" > text.file

If you want the billion numbers from 1,000,000,000 to 1,999,999,999

for ((i = 1000000000; i <= 1999999999; i++)); do
    echo "$i"
done > text.file

As suggested by @bac0n

seq 1000000000 1999999999 > text.file