我需要使用scala执行脚本。当我使用!新行后的字符串丢失。也就是说,"Here is the“字符串被更新为Jira,新行之后的字符串的另一部分丢失。据我所知,这是应该的!不维护新行。有人能建议我怎么解决这个问题吗?请参阅下面的代码。
import scala.sys.process._
val fileContent: String = """ Here is the
text with
new line """
Seq("/opt/atlassian-cli-2.6.0/atlassian.sh", "jira", "--action", "updateIssue", "--issue", "JIRA-2", "--field", "customfield_10664" ,"--values", fileContent).! 发布于 2012-07-31 17:19:27
正如您从下面的代码片段中看到的,!可以很好地维护换行符。你调用的脚本可能有问题?
scala> Seq("echo", """hello
| world""").!
hello
world
res5: Int = 0 https://stackoverflow.com/questions/11736252
复制相似问题