From 3e30a986bce002b9c7091127f31b446edd64849f Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bonicoli Date: Mon, 17 Jun 2024 02:04:16 +0200 Subject: [PATCH] Avoid deprecated variant egrep, use grep with the related option instead. --- rapport_activite/rapport_activite.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rapport_activite/rapport_activite.sh b/rapport_activite/rapport_activite.sh index 3eb848b..ad50462 100755 --- a/rapport_activite/rapport_activite.sh +++ b/rapport_activite/rapport_activite.sh @@ -62,10 +62,10 @@ generateHTTPReport() local errorRequestCount=$(zgrep "$monthEnglish" $LOG_PREFIX-error.log*|grep -c "$year") echo "Nombre de requêtes http en erreur = $errorRequestCount" - local ipv4VisitorCount=$(zgrep -h "$monthEnglish" $LOG_PREFIX-access.log*|grep "$year"|grep -vi bot|grep -v check_http|egrep "^$IPV4_PATTERN "|cut -d' ' -f1|sort|uniq|wc -l ) + local ipv4VisitorCount=$(zgrep -h "$monthEnglish" $LOG_PREFIX-access.log*|grep "$year"|grep -vi bot|grep -v check_http|grep -E "^$IPV4_PATTERN "|cut -d' ' -f1|sort|uniq|wc -l ) echo "Nombre d'ipv4 ayant visité le service = $ipv4VisitorCount" - local ipv6VisitorCount=$(zgrep -h "$monthEnglish" $LOG_PREFIX-access.log*|grep "$year"|grep -vi bot|grep -v check_http|egrep "^$IPV6_PATTERN "|cut -d' ' -f1|sort|uniq|wc -l ) + local ipv6VisitorCount=$(zgrep -h "$monthEnglish" $LOG_PREFIX-access.log*|grep "$year"|grep -vi bot|grep -v check_http|grep -E "^$IPV6_PATTERN "|cut -d' ' -f1|sort|uniq|wc -l ) echo "Nombre d'ipv6 ayant visité le service = $ipv6VisitorCount" echo "Nombre total d'ip ayant visité le service = $((ipv4VisitorCount+ipv6VisitorCount))" @@ -83,10 +83,10 @@ generateSpecificReport() echo "=§= Rapport d'activité spécifique" echo - ipv4UserCount=$(zgrep -h "$monthEnglish" $LOG_PREFIX-access.log*|grep "$year"|grep -vi bot|grep -v check_http|egrep "^$IPV4_PATTERN " | cut -d' ' -f 1|sort|uniq|wc -l ) + ipv4UserCount=$(zgrep -h "$monthEnglish" $LOG_PREFIX-access.log*|grep "$year"|grep -vi bot|grep -v check_http|grep -E "^$IPV4_PATTERN " | cut -d' ' -f 1|sort|uniq|wc -l ) echo "Nombre d'ipv4 utilisatrices du service = $ipv4UserCount" - ipv6UserCount=$(zgrep -h "$monthEnglish" $LOG_PREFIX-access.log*|grep "$year"|grep -vi bot|gre\p -v check_http|egrep "^$IPV6_PATTERN " | cut -d' ' -f 1|sort|uniq|wc -l ) + ipv6UserCount=$(zgrep -h "$monthEnglish" $LOG_PREFIX-access.log*|grep "$year"|grep -vi bot|grep -v check_http|grep -E "^$IPV6_PATTERN " | cut -d' ' -f 1|sort|uniq|wc -l ) echo "Nombre d'ipv6 utilisatrices du service = $ipv6UserCount" echo "Nombre total d'ip utilisatrices du service = $((ipv4UserCount+ipv6UserCount))"