Created
February 7, 2018 20:50
-
-
Save bench/c984c302aa000ae81136095188a14ffc 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