#!/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 "\033[47m "
else
echo -e -n "\033[40m "
fi
done
echo -e "\e[0m"
done
echo -n -e "\e[0m"
转载于:https://www.cnblogs.com/rav009/p/5131138.html