-
-
Notifications
You must be signed in to change notification settings - Fork 89
Birmingham | 26-SDC-Mar | Chioma Okeke | Sprint 2 | jq #403
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,3 +5,4 @@ set -euo pipefail | |
| # The input for this script is the person.json file. | ||
| # TODO: Write a command to output the address of the person, all on one line, with a comma between each line. | ||
| # Your output should be exactly the string "35 Fashion Street, London, E1 6PX", but should not contain any quote characters. | ||
| jq -jr '.address | join(", "), "\n"' < ./person.json | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why use
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Read about the -j flag as well, just a reminder that it takes out `\n' characters. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not specify the file input directly as
That is, without using input redirection?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used redirection as a reminder of different approaches I can use to solve the problem.