1 #!/bin/bash
   2 
   3 echo "Content-type: text/html"
   4 echo ""
   5 
   6 echo '<style>
   7 span#block {display: block; width: 600px;}
   8 div {width: 20px; height: 20px; float: left; text-align: center;
   9 font-family: verdana; font-size: 9px;}
  10 div.c0 {background-color: #AAA;}
  11 div.c1 {background-color: #CCC;}
  12 </style>
  13 <span id="block">'
  14 
  15 
  16 mostra() {
  17 i=0
  18 fnord="$1"
  19 for i in  `seq -s " " 0 28`
  20 do
  21 
  22   if [ $fnord = "0" ]
  23   then
  24     fnord="1"
  25   else
  26     fnord="0"
  27   fi
  28 
  29 
  30   case "$i" in
  31 
  32     "$2")  echo "<div class='c$4'>$fnord</div>";;
  33     "$3")  echo "<div class='c$4'>$fnord</div>";;
  34        *)   echo "<div>$fnord</div>";;
  35 
  36   esac
  37 
  38 i=`expr $i + 1`
  39 
  40 done
  41 }
  42 
  43 
  44 z=0
  45 zz=28
  46 x=0
  47 
  48 for i in  `seq -s " " 0  27`
  49 do
  50 
  51   if [ "$z:$zz" = "14:15" ]
  52   then
  53     echo -n ""
  54   else
  55 
  56     if [ "$x" -eq 1 ]
  57     then
  58       mostra 0 $z $zz 0
  59       #echo "<br />$z $zz"
  60       echo '<br />'
  61       x=2
  62     else
  63       mostra 1 $z $zz 1
  64       #echo "<br />$z $zz"
  65       echo '<br />'
  66       x=1
  67 
  68     fi
  69   fi
  70   z=`expr $z + 1`
  71   zz=`expr $zz - 1`
  72 
  73 done
  74 mostra 1 0 28 1
  75 
  76 echo "<pre>"
  77 cat testeLogica.cgi
  78 echo "</pre>"