I'm a bit new to bash so please excuse any naive questions or nooby stuff I do.
So I wrote a quick script that lists all tput colors, and it works pretty well. It looks like this:
unset x; for i in {1..256}; do tput setab $x; echo $x; x=$((x+1)); done
But I wanted to use less than/equal to instead of what I did above. I tried doing a bunch of stuff like this:
unset x; if [ $x -le 256] ; do tput setab $x ; echo $x ; x=$((x+1)) ; done
And this:
unset x; if [ $x -le 256] then do tput setab $x ; echo $x ; x=$((x+1)) ; done
But I can't get the syntax right, it just says unexpected token "done" or "do". Google didn't help me, nor did I find anything that answered my questions here on Stack Overflow. Also I'd like to be able to have it unset x after it reaches 256 and then keep repeating the script so it could look trippy. So yeah, if anyone could help I'd appreciate it, thanks.