User Tools

Site Tools


bash:loops:for_loop

BASH - Loops - For loop

The for loop iterates over codes efficiently.

#!/bin/bash
 
for (( counter=1; counter<=10; counter++ ))
do
echo -n "$counter "
done
 
printf "\n"

NOTE: This should print out the numbers 1 to 10.

bash/loops/for_loop.txt · Last modified: 2021/01/26 12:12 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki