#!/bin/bash for ((i=1;i<=8;i++)) do for ((j=1;j<=8;j++)) do let "total=($i+$j)" let "tmp=$total%2" if [ $tmp -eq 0 ] then echo -e -n " 33[47m " else echo -e -n " 33[40m " fi done echo -e "e[0m" done echo -n -e "e[0m"