Skip to content

Instantly share code, notes, and snippets.

@toshi75
Created July 12, 2022 04:42
Show Gist options
  • Save toshi75/8e6b5a264d8f7a7f0f3160fc55df066b to your computer and use it in GitHub Desktop.
Save toshi75/8e6b5a264d8f7a7f0f3160fc55df066b to your computer and use it in GitHub Desktop.
for each #shell
foreach (){
for i in {1st,2nd,3rd,4th,5th,.................} ;do
/do/something "$i"
done
ARRAY=(
1st
2nd
3rd
4th
5th
..
..
..
)
for i in "${ARRAY[@]}" ;do
/do/something "$i"
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment