Skip to content

Conversation

Luke-Manyamazi
Copy link

@Luke-Manyamazi Luke-Manyamazi commented Jul 22, 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 Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

This pull request includes the following changes:

Completed 10 exercises involving the use of the jq command to parse and manipulate JSON data in Bash scripts.
Accessed and extracted data from two JSON files: scores.json and person.json.
Implemented commands to:

  • Output player names and cities.
  • Sum numeric values using array aggregation.
  • Safely handle missing or malformed data using fallback logic.
  • Filter and sort nested JSON arrays.
  • Combine multiple fields into structured output.
    Ensured all scripts return the expected output format.

Briefly explain your PR.

This pull request contains a set of 10 exercises demonstrating the use of the jq command within shell scripts to query and manipulate JSON data. The tasks involve extracting specific fields, summing values, and formatting output from scores.json and person.json. The goal was to practice efficient JSON parsing using command-line tools in preparation for scripting tasks.

Questions

Ask any questions you have for your reviewer.

  1. Is there a best practice for handling missing or null values in JSON when using jq in scripts? (e.g., // 0 fallback)
  2. When constructing new arrays from filtered objects, is there a more efficient or readable way than [.[] | ...]?
  3. Are there common pitfalls or performance considerations when using jq on larger JSON files in real-world applications?
  4. Would you recommend using jq for production-level data parsing in scripts, or is it better to shift to a higher-level language like Python for complex logic?

@Luke-Manyamazi Luke-Manyamazi added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jul 22, 2025
@Luke-Manyamazi Luke-Manyamazi linked an issue Jul 23, 2025 that may be closed by this pull request
@LonMcGregor LonMcGregor added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Aug 4, 2025
@LonMcGregor
Copy link

Great work on this task - you are done with this part of the sprint

@Luke-Manyamazi
Copy link
Author

Thank you!

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 all review comments have been addressed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[TECH ED] jq exercises
2 participants