Skip to content

Running command that pipes to another command #104

Description

@lordcodes

Describe the problem

Currently, there is no way via the API to pipe the output of a command into another command. For example to run something similar to:

echo '{"key":"value"}' | jq '.'

Describe your solution

  • Work out how to actually pipe one command into another using Process as currently it doesn't work. Likely the issue relates to the standard out and in being redirected/captured as streams.
  • Commands can be a structure rather than just executed immediately as a function like now.
  • A Pipeline structure can then be built from a series of Commands and then executed all together with each command piping into the next.

Checklist

Additional context

It looks like a change may be made with how the command(s) are prepared and built using ProcessBuilder so that they are executed correctly.

Workaround
Currently, you can run multiple commands by simply capturing the output of the first command into a Kotlin property and then running the second command using its value as input.

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions