Created
January 29, 2013 16:32
-
-
Save sosukeinu/4665588 to your computer and use it in GitHub Desktop.
BASH comma-separated list of numbers
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 | |
echo "Input variable #1 " | |
read var1 | |
echo "variable #1 = $var1" | |
echo | |
echo "Input variable #2 " | |
read var2 | |
echo "variable #2 = $var2" | |
echo | |
# ------------------------------------------- # | |
# As with "for" and "while" loops, | |
#+ an "until" loop permits C-like test constructs. | |
until (( var1 > var2 )) | |
do # ^^ ^ ^ ^^ No brackets, no $ prefixing variables. | |
echo -n "$var1," | |
(( var1++ )) | |
done # 0,1,2,3,4,5,6,7,8,9,10, | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment