wKiom1eVmMvQyyfpAAAIcql6ZFE287.gif

1.echo.sh

#!/bin/bash
#test
echo "======================================"
echo -n "input number:"
read a
echo "number=$a"
#this number also can be input

    function ran(){
          min=$1
          max=$(($2-$min+1))
          num=$(cat /dev/urandom | head-n 10 | cksum | awk -F ' ' '{print $1}')
          echo $(($num%$max+$min))

}

for ((i=1;i<=a;i+=2))
  do
  for((k=0;k<(i-1)/2;k++ ))
    do
     echo -n " "
     done
   for((j=i;j<=a;j++))
     do
      nu1=$(ran 30 37)
      nu2=$(ran 40 47)
      m=`echo -e"\033[$nu2;$nu1;5m*\033[0m "`
    echo -n $m
     done
    echo ' '
done



chmod +x echo.sh 

./echo.sh


2.

date -d "10 days ago"


date -d "-20 days ago"