diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2019-04-28 22:16:12 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2019-04-28 22:16:34 +0100 |
commit | 2cecabd75ecb19e46c221c76f642807869ae63e6 (patch) | |
tree | 8b2be7186d8bbaabfe85ad54bf3dd228674aac3f | |
parent | 5489796737108cb9bba01f831421e531a50b946b (diff) | |
download | rtmux-2cecabd75ecb19e46c221c76f642807869ae63e6.tar.gz rtmux-2cecabd75ecb19e46c221c76f642807869ae63e6.tar.bz2 rtmux-2cecabd75ecb19e46c221c76f642807869ae63e6.zip |
Fix gseq use in RGB colour script.
-rw-r--r-- | tools/24-bit-color.sh | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/tools/24-bit-color.sh b/tools/24-bit-color.sh index b83ef51f..3e91da20 100644 --- a/tools/24-bit-color.sh +++ b/tools/24-bit-color.sh @@ -14,9 +14,23 @@ # https://github.com/gnachman/iTerm2/blob/master/LICENSE # -if which gseq >/dev/null 2>&1 -then - SEQ=gseq +SEQ1= +if which gseq >/dev/null 2>&1; then + SEQ1=gseq +elif seq --version|grep -q GNU; then + SEQ1=seq +fi +if [ -n "$SEQ1" ]; then + # GNU seq requires a -ve increment if going backwards + seq1() + { + if [ $1 -gt $2 ]; then + $SEQ1 $1 -1 $2 + else + $SEQ1 $1 $2 + fi + } + SEQ=seq1 else SEQ=seq fi |