#!/bin/ksh
# cd [to where you want to go here]

x=`expr $RANDOM % 10`
c="white"
if [ "$x" = "0" ]; then
 c="white"
elif [ "$x" = "1" ]; then
 c="fuchsia"
elif [ "$x" = "2" ]; then
 c="gray"
elif [ "$x" = "3" ]; then
 c="green"
elif [ "$x" = "4" ]; then
 c="lime"
elif [ "$x" = "5" ]; then
 c="maroon"
elif [ "$x" = "6" ]; then
 c="navy"
elif [ "$x" = "7" ]; then
 c="olive"
elif [ "$x" = "8" ]; then
 c="silver"
elif [ "$x" = "9" ]; then
 c="yellow"
fi 
for j in `ls *_files/*.css`; do
 if [ "`cat $j | grep -c '[#]header_layer'`" = "1" ]; then
   restn="`cat $j | grep -n '[#]header_layer' | cut -d':' -f1`"
   cat $j | head -$restn > ${j}.jnk
   cat ${j}.jnk > $j
   rm -f ${j}.jnk
   echo "" >> $j
   echo " background-color: $c " >> $j
   echo "} " >> $j
 else
   echo "" >> $j
   echo "#header_layer { " >> $j
   echo " background-color: $c " >> $j
   echo "} " >> $j
 fi
done
exit
