Skip to content

Instantly share code, notes, and snippets.

@k1dbl4ck
Last active April 20, 2020 09:22
Show Gist options
  • Save k1dbl4ck/d79d50709b34f71c88fe6e1a55e46fd4 to your computer and use it in GitHub Desktop.
Save k1dbl4ck/d79d50709b34f71c88fe6e1a55e46fd4 to your computer and use it in GitHub Desktop.
#!/bin/sh
RESULT=""
if [ -p /dev/stdin ]; then
while read -ra line ; do
if [[ $line[0] == *"[90m/"* ]]; then
unset 'line[0]'
ROW=$(echo "${line[*]}" | tr "(\n)" " ")
RESULT="$RESULT$ROW\n"
fi
done
echo "$RESULT" | sort | uniq -c
echo "---------------------------------------------------------"
echo "$RESULT" | sort | uniq -c | awk '{SUM+=$1}END{print SUM}'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment