A DESCRIPTION OF THE REQUEST :
In Java 9, there will be a new API to create a pipeline of processes: https://bugs.openjdk.java.net/browse/JDK-8132394
I would like Nashorn to provide direct support for this.
JUSTIFICATION :
Pipelines are very common in shell scripts. Having direct support for them in Nashorn, would greatly increase its suitability for such scripts. Moreover, Java 9 provides ProcessBuilder support for this, so the Nashorn implementation can build on this API.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I propose the following:
$PIPE("ls -l", "grep key", "less")
There should also be a way to provide input to a pipe. However, a different name will need to be used for this, to avoid ambiguity (i.e. is the last argument part of the pipeline, or the input?).
In Java 9, there will be a new API to create a pipeline of processes: https://bugs.openjdk.java.net/browse/JDK-8132394
I would like Nashorn to provide direct support for this.
JUSTIFICATION :
Pipelines are very common in shell scripts. Having direct support for them in Nashorn, would greatly increase its suitability for such scripts. Moreover, Java 9 provides ProcessBuilder support for this, so the Nashorn implementation can build on this API.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I propose the following:
$PIPE("ls -l", "grep key", "less")
There should also be a way to provide input to a pipe. However, a different name will need to be used for this, to avoid ambiguity (i.e. is the last argument part of the pipeline, or the input?).
- duplicates
-
JDK-8141209 $EXEC should allow streaming
-
- Resolved
-