Running command that pipes to another command
See original GitHub issueDescribe 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
- I’ve read the guide for contributing.
- I’ve checked there are no other open pull requests for the feature.
- I’ve checked there are no other open issues for the same feature.
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.
Issue Analytics
- State:
- Created a year ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
How to pipe command output to other commands? - bash
Save this answer. Show activity on this post. This can be achieved in several ways, such as pipe | , STDERR 2> ,...
Read more >Working with pipes on the Linux command line
One of the most powerful shell operators is the pipe ( | ). The pipe takes output from one command and uses it...
Read more >Pass the output of previous command to next as an argument
I generally use `command` to place it's output as argument to another command. For e.g., to find resource consumed by process foo on...
Read more >Learn the Command Line: Redirecting Input and Output ...
The | command is called a pipe. It is used to pipe, or transfer, the standard output from the command on its left...
Read more >Pipe, Grep and Sort Command in Linux/Unix with Examples
The Pipe is a command in Linux that lets you use two or more commands such that output of one command serves as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I agree. I have created #120 to track the Command abstraction.
If the dependency is an issue, we can put the pipeline feature in a separate module.
Also it was fun to discuss but I don’t really need pipelines right now.
Having the Command abstraction on the other hand would be really helpful.
Le jeu. 11 août 2022 à 13:26, Andrew Lord @.***> a écrit :