From 63f74932c5420e19a6422a81b5cd9a07fe9b73c3 Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Thu, 31 Oct 2019 17:44:48 +0100 Subject: [PATCH] Script calculate --- calcular-porcentaje.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 calcular-porcentaje.sh diff --git a/calcular-porcentaje.sh b/calcular-porcentaje.sh new file mode 100644 index 0000000..d39bf9e --- /dev/null +++ b/calcular-porcentaje.sh @@ -0,0 +1,8 @@ +#!/bin/bash +CSV="resources/top-1m.csv" +NUM_WORDPRESS=$(cat $CSV | grep ,true$ | wc -l) +NUM_NOT_WORDPRESS=$(cat $CSV | grep ,false$ | wc -l) +NUM_TIMEOUT=$(cat $CSV | grep ,timeout$ | wc -l) +TOTAL=$(cat $CSV | wc -l) + +echo "($NUM_WORDPRESS * 100) / ($TOTAL - $NUM_TIMEOUT)" | bc