Skip to content

Commit 2d1a6b3

Browse files
1-3 solving
1 parent 3f26722 commit 2d1a6b3

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

jq/script-01.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ set -euo pipefail
55
# The input for this script is the person.json file.
66
# TODO: Write a command to output the name of the person.
77
# Your output should be exactly the string "Selma", but should not contain any quote characters.
8+
9+
# cat person.json | jq -r .name
10+
11+
jq -r '.name' person.json

jq/script-02.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ set -euo pipefail
55
# The input for this script is the person.json file.
66
# TODO: Write a command to output the address of the person, all on one line, with a comma between each line.
77
# Your output should be exactly the string "35 Fashion Street, London, E1 6PX", but should not contain any quote characters.
8+
9+
jq -r '.address | join(", ")' person.json

jq/script-03.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ set -euo pipefail
55
# The input for this script is the person.json file.
66
# TODO: Write a command to output the name of the person, then a comma, then their profession.
77
# Your output should be exactly the string "Selma, Software Engineer", but should not contain any quote characters.
8+
9+
jq -r -j '.name .profession' person.json

0 commit comments

Comments
 (0)