Skip to content

Loop over JSON input #8

Open
Open

Description

@Miserlou

Maybe something like..

$ loop 'echo $VALUE > $KEY' --for-dict "{'hello', 'world'}"
$ cat hello
world

Activity

  1. michaelmior commented on Jul 9, 2018

    @michaelmior
    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.

  2. Miserlou commented on Jul 10, 2018

    @Miserlou
    OwnerAuthor

    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.

  3. michaelmior commented on Jul 10, 2018

    @michaelmior
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions