Skip to content

London | 26-SDC-Mar | Craig D'Silva | Sprint 2 | jq#393

Open
craig-dsilva wants to merge 3 commits into
CodeYourFuture:mainfrom
craig-dsilva:jq
Open

London | 26-SDC-Mar | Craig D'Silva | Sprint 2 | jq#393
craig-dsilva wants to merge 3 commits into
CodeYourFuture:mainfrom
craig-dsilva:jq

Conversation

@craig-dsilva

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes

Changelist

I have completed the jq exercises.

@craig-dsilva craig-dsilva added 🐂 Size Medium 1-4 hours 📅 Sprint 2 Assigned during Sprint 2 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Tools The name of the module. labels Mar 19, 2026

@cjyuan cjyuan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Solution works. I just have a few questions.

Comment thread jq/script-01.sh Outdated
# TODO: Write a command to output the name of the person.
# Your output should be exactly the string "Selma", but should not contain any quote characters.

cat person.json | jq -r ".name" No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why not specify the input filename directly as:

jq -r .name person.json

?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I thought cat with pipelines was required. Didn't know I could use it directly, just like grep.

Comment thread jq/script-03.sh Outdated
# TODO: Write a command to output the name of the person, then a comma, then their profession.
# Your output should be exactly the string "Selma, Software Engineer", but should not contain any quote characters.

cat person.json | jq -j '[.name, .profession] | join (", ")' No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why use -j option on this particular command?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I wanted to get a raw output to match the terminal format.

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels May 9, 2026
@craig-dsilva craig-dsilva added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Tools The name of the module. Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 🐂 Size Medium 1-4 hours 📅 Sprint 2 Assigned during Sprint 2 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants