#!/bin/bash
# compte le nb d'occurence d'un mot en $1 dans le fichier $2
word="$1"
file="$2"
if [ -f "$file" ]
then
	cat $file | erg-mots | grep -i "$word" > tmp2
else
	echo -e "\nPlease write the word to count in \$1 and the file in \$2\n"
	exit
fi
echo "J'ai trouvé $(wc -l tmp2 | cut -f1 -d " ") occurence(s) de $word dans $file :"
# cat tmp2
