From 9f6b588083b76fc3840c2ab7c6fad8d5652e0ef6 Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bonicoli Date: Mon, 17 Jun 2024 02:03:02 +0200 Subject: [PATCH] Use 'grep -c' instead of 'wc -l' --- rapport_activite/rapport_activite.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rapport_activite/rapport_activite.sh b/rapport_activite/rapport_activite.sh index 11a443c..3eb848b 100755 --- a/rapport_activite/rapport_activite.sh +++ b/rapport_activite/rapport_activite.sh @@ -50,10 +50,10 @@ generateHTTPReport() echo "=§= Rapport d'activité HTTP" echo - local httpRequestCount=$(zgrep "$monthEnglish" $LOG_PREFIX-access.log*|grep $year|wc -l) + local httpRequestCount=$(zgrep "$monthEnglish" $LOG_PREFIX-access.log*|grep -c $year) echo "Nombre total de requêtes http = $httpRequestCount" - local trueHttpRequestCount=$(zgrep "$monthEnglish" $LOG_PREFIX-access.log*|grep $year|grep -vi bot|grep -v check_http|wc -l) + local trueHttpRequestCount=$(zgrep "$monthEnglish" $LOG_PREFIX-access.log*|grep $year|grep -vi bot|grep -c -v check_http) echo "Nombre de vraies requêtes http = $trueHttpRequestCount" local botRequestCount=$(zgrep "$monthEnglish" $LOG_PREFIX-access.log*|grep "$year"|grep -i bot|grep -c -v check_http)