Skip to content

Instantly share code, notes, and snippets.

@NanoDano
Created June 3, 2020 21:09
Show Gist options
  • Save NanoDano/43664732b1cb4a6512cf6ba2dfc3ba7f to your computer and use it in GitHub Desktop.
Save NanoDano/43664732b1cb4a6512cf6ba2dfc3ba7f to your computer and use it in GitHub Desktop.
Bash For loop examples
# 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