Andrea Phillips · @andrhia
716 followers · 3182 posts · Server wandering.shop

Second part of the shell script:

the filenames from the output

sed 's/[ \t]*\([0-9]\{1,\}\).*/\1/' wctmp1 > wctmp2

it all up

{ s=0;while read l; do s=$((s+$l));done<wctmp2;echo $s; } > wctmp3

the daily total and date to our csv file

echo "$(<wctmp3), $(date +%D)" >> wordcountlog.csv

so we never wind up adding on to yesterday's numbers
rm wctmp*

#removes #add #cleanup

Last updated 2 years ago

eicker.news #technews · @technews
41 followers · 124 posts · Server eicker.news
Parliamo di news! · @parliamodinews
16 followers · 87657 posts · Server masthead.social
Parliamo di news! · @parliamodinews
15 followers · 87554 posts · Server masthead.social