Skip to content

Commit a225eda

Browse files
committed
fix: jq exercises
1 parent 122c8cb commit a225eda

5 files changed

Lines changed: 5 additions & 5 deletions

File tree

jq/script-05.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ set -euo pipefail
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.
88

9-
jq -r '.[] | "\(.name), \(.city)"' scores.json
9+
jq -r '.[] | "\(.name) \(.city)"' scores.json

jq/script-06.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ set -euo pipefail
77
# Your output should contain 6 lines, each with one word and one number on it.
88
# The first line should be "Ahmed 1" with no quotes.
99

10-
jq -r '.[] | "\(.name), \(.scores[0])"' scores.json
10+
jq -r '.[] | "\(.name) \(.scores[0])"' scores.json

jq/script-07.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ set -euo pipefail
77
# Your output should contain 6 lines, each with one word and one number on it.
88
# The first line should be "Ahmed 4" with no quotes.
99

10-
jq -r '.[] | "\(.name), \(.scores[-1])"' scores.json
10+
jq -r '.[] | "\(.name) \(.scores[-1])"' scores.json

jq/script-08.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ set -euo pipefail
66
# TODO: Write a command to output just the names of each player along with the number of times they've played the game.
77
# Your output should contain 6 lines, each with one word and one number on it.
88
# The first line should be "Ahmed 3" with no quotes.
9-
jq -r '.[] | "\(.name), \(.scores | length)"' scores.json
9+
jq -r '.[] | "\(.name) \(.scores | length)"' scores.json

jq/script-09.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ set -euo pipefail
66
# TODO: Write a command to output just the names of each player along with the total scores from all of their games added together.
77
# Your output should contain 6 lines, each with one word and one number on it.
88
# The first line should be "Ahmed 15" with no quotes.
9-
jq -r '.[] | "\(.name), \(.scores | add)"' scores.json
9+
jq -r '.[] | "\(.name) \(.scores | add)"' scores.json

0 commit comments

Comments
 (0)