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