使用 Scala 的 sys.process API 无法调用带引号字符串的命令
Trouble invoking command with quoted string using Scala's sys.process API
从以下控制台会话中可以看出,从 Scala 调用的相同命令产生的结果与在终端中 运行 时产生的结果不同。
~> scala
Welcome to Scala 2.12.6 (OpenJDK 64-Bit Server VM, Java 1.8.0_172).
Type in expressions for evaluation. Or try :help.
scala> import sys.process._
import sys.process._
scala> """emacsclient --eval '(+ 4 5)'""".!
*ERROR*: End of file during parsingres0: Int = 1
scala> :quit
~> emacsclient --eval '(+ 4 5)'
9
有没有人遇到过这个问题and/or知道解决方法吗?
我认为这可能是一个库错误,所以也打开了一个问题:https://github.com/scala/bug/issues/10897
Scala 的 sys.process
api 好像不支持引用。以下作品:Seq("emacsclient", "--eval", "(+ 4 5)").!
.
从以下控制台会话中可以看出,从 Scala 调用的相同命令产生的结果与在终端中 运行 时产生的结果不同。
~> scala
Welcome to Scala 2.12.6 (OpenJDK 64-Bit Server VM, Java 1.8.0_172).
Type in expressions for evaluation. Or try :help.
scala> import sys.process._
import sys.process._
scala> """emacsclient --eval '(+ 4 5)'""".!
*ERROR*: End of file during parsingres0: Int = 1
scala> :quit
~> emacsclient --eval '(+ 4 5)'
9
有没有人遇到过这个问题and/or知道解决方法吗?
我认为这可能是一个库错误,所以也打开了一个问题:https://github.com/scala/bug/issues/10897
Scala 的 sys.process
api 好像不支持引用。以下作品:Seq("emacsclient", "--eval", "(+ 4 5)").!
.