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

Loop over JSON input #8

Open
Miserlou opened this issue Jun 13, 2018 · 3 comments
Open

Loop over JSON input #8

Miserlou opened this issue Jun 13, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@Miserlou
Copy link
Owner

Miserlou commented Jun 13, 2018

Maybe something like..

$ loop 'echo $VALUE > $KEY' --for-dict "{'hello', 'world'}"
$ cat hello
world
@Miserlou Miserlou added the enhancement New feature or request label Jun 13, 2018
@michaelmior
Copy link
Contributor

Did you mean ['hello', 'world']? {} is used for objects in JSON while [] is for arrays. I'm also not sure why JSON is needed here. Also, something like --for-each might be a better name for the flag since there's no dictionaries involved.

@Miserlou
Copy link
Owner Author

Basically I wanted to do be able to open simple .json files and so something with the list items and key:value pairs. I have a lot of JSON files.

@michaelmior
Copy link
Contributor

I totally missed in the example that you had separate variables for $KEY and $VALUE. You can ignore most of my comment :)

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

No branches or pull requests

2 participants