commit cf449f3b66da8a714adb50b7394becb236fde1b2
parent 78b5901018060d1ca0dd899ca0b82f7b3375e7db
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Tue, 19 May 2020 19:07:16 +0200
Make colors-256 work in any shell
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/.local/bin/colors-256.sh b/.local/bin/colors-256.sh
@@ -1,8 +1,10 @@
#!/bin/sh
+i=0
j=0
-for i in $(seq 0 255); do
+while [ "$i" -le 255 ]; do
printf "\x1b[48;5;%sm%3d\e[0m " "$i" "$i"
+ i=$(($i+1))
j=$(($j+1))
if [ $j -eq 16 ]; then
j=0