Closed jameslikeslinux closed 7 years ago
Example, on the command line:
> uname -a
SunOS <snip>.umd.edu 5.10 Generic_150400-50 sun4v sparc sun4v
> bash --version
GNU bash, version 3.2.57(1)-release (sparc-sun-solaris2.10)
Copyright (C) 2007 Free Software Foundation, Inc.
> bash -c 'end=5; for ((i = 1; i <= end; i++)); do echo $i; done'
1
2
3
4
5
Awesome. Thanks @iamjamestl, that makes sense to me. Thanks!
In #28, I changed the for loop in the
get_repeated_scroll_cmd
function to use a bash built-in becauseseq
is not portable (for example, it doesn't exist on Solaris). However, I must have been accidentally testing under ZSH, because the range operator ({1..x}
) does not support variable interpolation under bash. This commit changes the for loop to using a math operator, which I have confirmed is compatible with bash (at least back to version 3, which is quite old); and as a built-in, is portable.