#!/bin/sh
#] 
#] *********************
#] $ bash "$d_bin""word counts in a file for each item in a dictionary file.sh" - res ipsa loquitor
# www.BillHowell.ca  18Jun2021 initial 



#************************
# List of operators, generated with :
# $ grep  "^#]"  "$d_bin""word counts in a file for each item in a dictionary file.sh" |  sed "s/^#\]/  /" 

#




#************************
# Setup 

source  "$d_bin""standard header.sh"

# see "$d_bin""Standard header.sh"
# 	date_ymdhm=$(date +"%y%m%d %kh%Mm")
# 	becho - echo to [screen, logfile]
# 	beval - echo command to [screen, logfile] then eval it
#		for extreme examples of beval : 
#		$ find  "/home/bill/PROJECTS/bin/"  -maxdepth 1  -type f  -name "*.sh"  |   tr  \\n  \\0  |  xargs -0  -IFILE  grep  --with-filename  --line-number  "beval" "FILE"  
#				backup computer [to,from] TravelUSB.sh:29
#				encrypt-open.sh:34



#************
# code 

#] word_counts() 

	word_counts()
{  
	while read LINE; do 
		counts=$(  grep  -c  "$LINE"  "$2"  )
		echo  "$counts""\t""$LINE"  >>"$3"
	done < "$1"
}  

# && [[ $word != end ]]

#*******************************************************************************
# examples

Fauchi_emails()
{  
	d_Fauchi="$d_webRawe""Pandemics, health, and the Sun/corona virus/Fauci covid emails/"
	p_dict="$d_Fauchi""7_word non-[numeric, empty] list.txt"
	p_emls="$d_Fauchi""210609 Leopold - Anthony Fauci emails, NIH Freedom Of Information Act.pdf"
	p_rslt="$d_Fauchi""7_word counts of dictionary items.txt"
	word_counts  "$p_dict"  "$p_emls"  "$p_rslt"  
}  





#************
# run - select one of options

	Fauchi_emails  










# $ bash  "$d_bin""word counts in a file for each item in a dictionary file.sh"  



# enddoc
