eolas/Programming_Languages/Shell/Loops_in_bash.md
2023-03-05 08:02:49 +00:00

305 B

categories tags
Programming Languages
shell

Loops in bash

Loop through an array

for element in "${arr[@]}"
do
    echo "$element"
done

Traditional for loop with upper and lower increment range

for (( i=0; i<=5;i++  )); do
  echo $i
done

# 1 2 3 4 5