File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -5,4 +5,6 @@ set -euo pipefail
55# The input for this script is the scores.json file.
66# TODO: Write a command to output the names of each player, as well as their city.
77# Your output should contain 6 lines, each with two words on it.
8- jq -r ' .[]| {"name":.name, "city":.city} | join(" ")' scores.json
8+ # jq -r '.[]| {"name":.name, "city":.city} | join(" ")' scores.json
9+
10+ jq -r ' .[] | .name + " " + .city' scores.json
Original file line number Diff line number Diff line change @@ -5,4 +5,6 @@ set -euo pipefail
55# The input for this script is the scores.json file.
66# TODO: Write a command to output the total of adding together all scores from all games from all players.
77# Your output should be exactly the number 164.
8- jq ' [.[].scores] | add | add' scores.json
8+ # jq '[.[].scores] | add | add' scores.json
9+
10+ jq ' [.[].scores] | flatten | add' scores.json
You can’t perform that action at this time.
0 commit comments