Get bash script code example to loop over a range of numbers. In this code you can provide any valid number to the variable. This loop works like for loops in javascript, php, python etc.
Code Example –
#!/bin/bash
VAR=10
for ((i=0;i<=VAR;i++)); do
printf '%s\n' "$i"
done
# Output:
# 0
# 1
# 2
# 3
# 4
# 5
# 6
# 7
# 8
# 9
# 10