How to write an infinite loop echoing numbers from 1 to infinite in bash. I am using a for loop but it is being killed by bash on using value more than 100000000.
#!/bin/bash
for a in {1..100000000..1}
do
echo "$a"
done
any alternative for it?
Have you tried doing a while loop?
#!/bin/bash
num=0;
while :
do
num=$((num+1))
echo "$num"
done
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With