Thursday, June 17, 2021

Plots Per Day… CHIA that is.

GREP=/usr/bin/grep
ECHO=/usr/bin/echo
AWK=/usr/bin/awk
CAT=/usr/bin/cat
SORT=/usr/bin/sort
WC=/usr/bin/wc
YEAR=2021

FILE=/var/log/totalplots
TFILE=/var/log/totalplots.sorted

$CAT $FILE | $AWK -F- ‘{ print $4”.”$5”.”$3 }’ | $SORT -n > $TFILE

for MONTH in 01 02 03 04 05 06 07 08 09 10 11 12
do
for DAY in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
do
X=`$CAT $TFILE |$GREP $MONTH.$DAY.$YEAR | $WC -l`
if ( test $X -ne 0)
then $ECHO $MONTH.$DAY.$YEAR” = “$X
fi
done
done