Skip to content
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

How to print sub-items of a key? #152

Open
BlueFalconHD opened this issue May 31, 2021 · 3 comments
Open

How to print sub-items of a key? #152

BlueFalconHD opened this issue May 31, 2021 · 3 comments

Comments

@BlueFalconHD
Copy link

I have a file, assets.json:

{
 "window":{
         "bottom":"_"
 }
}

I tried to cat the file while piping it with JSON:
cat assets.json | json window bottom
which outputs:

{
  "bottom": "_"
}

I want it to just output the value of the key bottom.

Like:
_

@rhettjay
Copy link

cat assets.json | json window.bottom

@BlueFalconHD
Copy link
Author

Really helpful! (Thanks for responding 2 years after my issue!!!)

@rhettjay
Copy link

Of course! I was looking through the issues searching for an answer to an issue I'm coming across with arrays. Figured might as well help anyone who runs into the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants