I want to change this python3 code:
for i in range(3,70):
print (i)
into code that runs in macOS Mojave terminal
I am guessing something like:
for i in {3..70}; do print(i); done
?
I want to change this python3 code:
for i in range(3,70):
print (i)
into code that runs in macOS Mojave terminal
I am guessing something like:
for i in {3..70}; do print(i); done
?
Close but - use echo
instead of print. With the following bash syntax:
for i in {3..70}
do
echo $i
done
This question has a wealth of information on this topic:
How do I iterate over a range of numbers defined by variables in Bash?
If you want to use a variable instead of constant values, you can use this:
for i in $(seq 1 $VAR); do echo $i; done