Created
January 27, 2012 19:50
-
-
Save starzia/1690584 to your computer and use it in GitHub Desktop.
A bash implementation of the GNU seq command found on most unix systems. This is useful on AIX (which seems to lack seq)
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
#!/bin/bash | |
# Implements GNU seq functionality. | |
# Useful on IBM AIX systems which don't have GNU coreutils. | |
if [ -z "$3" ]; then | |
# if no third arg | |
incr=1 | |
j=$2 | |
else | |
incr=$2 | |
j=$3 | |
fi | |
i=$1 | |
while [[ i -le j ]]; do | |
echo $i | |
let i+=$incr | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Are we to add this to our existing script?