Created
June 3, 2020 21:09
-
-
Save NanoDano/43664732b1cb4a6512cf6ba2dfc3ba7f to your computer and use it in GitHub Desktop.
Bash For loop examples
This file contains hidden or 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
# Specific number of iterations | |
for i in $(seq 1 10) | |
do | |
echo $i | |
done | |
# Specify list | |
for x in test.txt misc.txt other.txt | |
do | |
rm $x | |
done | |
# Traditional for loop | |
for (( c=1; c<=5; c++ )) | |
do | |
echo "hi" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment