Skip to content

Instantly share code, notes, and snippets.

@asim
Created December 3, 2010 18:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asim/727360 to your computer and use it in GitHub Desktop.
Save asim/727360 to your computer and use it in GitHub Desktop.
integer for loops in bash
for i in {1..100}; do echo foo; done
for ((i=1; i<=100; i++)); do echo foo; done
for `seq 1 100`; do echo foo; done
# while version
i=1; while [ $i -le 100 ]; do echo foo; i=$(($i+1)); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment