From 3a3c51ea53b91b78f124cc4763d3b60f6c4dcde8 Mon Sep 17 00:00:00 2001 From: d4rkr41n Date: Tue, 3 Dec 2019 09:03:32 -0600 Subject: [PATCH] Fixed Flag Counting Script --- numFlagsGot.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/numFlagsGot.sh b/numFlagsGot.sh index 1006c41..4f058b6 100755 --- a/numFlagsGot.sh +++ b/numFlagsGot.sh @@ -1 +1,12 @@ -cat correctlog.txt | grep $(cat config.json | grep \"name\" | cut -d '"' -f 4 | awk '{print $1}' | sed "s/^/\(/" | sed "s/$/\)/") | grep -v "Start" | awk '{print $2$3$4}' | sort -u | wc -l \ No newline at end of file +readarray -t <<< $(cat config.json | grep \"name\" | cut -d '"' -f 4 | awk '{print $1}' | sed "s/^/\(/" | sed "s/$/\)/") # split to array $names + +for (( i=0; i<${#MAPFILE[@]}; i++ )) +do + echo "$i: ${MAPFILE[$i]}" +done +read -p "Pick a team: " tnum + +activeTeam="${MAPFILE[$tnum]}" + +#activeTeam=$(cat config.json | grep \"name\" | grep \"active\"\:\"1\" | cut -d '"' -f 4 | awk '{print $1}' | sed "s/^/\(/" | sed "s/$/\)/") +echo $(cat correctlog.txt | grep "$activeTeam" | grep -v "Start" | awk '{print $2$3$4}' | sort -u | wc -l) flags found \ No newline at end of file