I am trying to implement a nested for loop in bash where the inner loop uses the current value of the outer loop in its range but I am getting this error "/drawgraph.sh: line 19: {0..1}: syntax error: operand expected (error token is "{0..1}")"
Here is my code:
for i in {0..499}
do
for j in {0..$i}
do
# other code
done
done
Here's a java analogy for what I'm trying to do:
for (int i = 0; i < 499; i++) {
for (int j = 0; j < i; j++) {
// some code
}
}