jsonPath lab issue

Hi

   I’m doing the JsonPath course in kodekloud to improve my skills in k8s. In the second lab (Json Path 1 - introduction), in the first exercise i’m writing this:

cat q1.json | jpath $.property1 > /root/answer1.sh

But the lab fails. It says the query should have the [ ] so I’m not sure how is required in the labs.

The lab could be a bit clearer what they mean by “put the command in a file”. What they really want you to do is

echo 'cat q1.json | jpath $.property1' > /root/answer1.sh
1 Like

Thanks @rob_kodekloud for the help. What differences does the echo in the format ?

The content of answer1.sh file will be:

cat q1.json | jpath $.property1

Thanks @rob_kodekloud. I don’t know why in a minute my mind thinks that the ouput of echo should be different :upside_down_face:

Have nice evening!