Last active
December 23, 2015 12:29
-
-
Save jimCresswell/6635294 to your computer and use it in GitHub Desktop.
Simple sh for loop script taking an optional number of loops argument
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
| #!/usr/bin/env sh | |
| # Parse input | |
| if [ "$#" -gt "0" ] | |
| then | |
| NUMLOOPS=$1 | |
| else | |
| NUMLOOPS=10 | |
| fi | |
| # Run tests | |
| for ((i = 1; i <= $NUMLOOPS; i++)) | |
| do | |
| echo $i | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment