Is there any way to redirect stdin/stdout for the sbt run
task? I can do it from the Bash shell like this:
sbt run < myfile.txt
But not from the sbt console. This doesn't work, for instance:
> run < myfile.txt
You can write a custom runWithInput
task which does this for you by running a new JVM process with the input redirected from an argument file.
See https://github.com/harrah/xsbt/wiki/Process and https://github.com/harrah/xsbt/wiki/Getting-Started-Custom-Settings.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With