Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

London | Elhadj Abdoul Diallo | Module-Tools | WEEK2- Jq-exercises #18

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

eediallo
Copy link

@eediallo eediallo commented Feb 28, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

@eediallo eediallo added the Needs Review Participant to add when requesting review label Feb 28, 2025
Copy link

@mjpeet mjpeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work, your knowledge in writing scripts to achieve different tasks is getting better!

@@ -5,3 +5,4 @@ set -euo pipefail
# The input for this script is the scores.json file.
# TODO: Write a command to output the names of each player, as well as their city.
# Your output should contain 6 lines, each with two words on it.
jq -r '.[] | [.name, .city] | join(" ")' scores.json
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most of your solution is based on piping to "join" - this is not a problem at all! but as an example, think about what may be the difference when compared to this solution:

jq -r '.[] | "(.name) (.city)"' scores.json

(both solutions have the same result)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I'll definitely use both of the them.

@mjpeet mjpeet added 📅 Sprint 2 Assigned during Sprint 2 of this module Reviewed Volunteer to add when completing a review Complete Volunteer to add when work is complete and review comments have been addressed and removed Needs Review Participant to add when requesting review labels Mar 2, 2025
@eediallo
Copy link
Author

eediallo commented Mar 3, 2025

Thank you for reviewing my work @mjpeet !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Complete Volunteer to add when work is complete and review comments have been addressed Reviewed Volunteer to add when completing a review 📅 Sprint 2 Assigned during Sprint 2 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants