-
-
Save antonioiksi/ace3352816e4f99494f8073ce4575dc6 to your computer and use it in GitHub Desktop.
while and for loop syntax in bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# While loop | |
while [ $i -lt 10 ]; | |
do | |
[...] | |
done | |
# C style for loop | |
for (( c=1; c<=$MAX_VAL; c++ )) | |
do | |
[...] | |
done | |
# for...in loop | |
for var in $(seq 1 4) | |
do | |
[...] | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment