【发布时间】:2011-01-27 20:53:41
【问题描述】:
我正在编译 Scala 代码并将输出控制台输出写入文件。我只想将 STDOUT 的最后一行保存在文件中。这是命令:
scalac -Xplugin:divbyzero.jar Example.scala >> output.txt
scalac -Xplugin:divbyzero.jar Example.scala 的输出为:
helex@mg:~/git-repositories/my_plugin$ scalac -Xplugin:divbyzero.jar Example.scala | tee -a output.txt
You have overwritten the standard meaning
Literal:()
rhs type: Int(1)
Constant Type: Constant(1)
We have a literal constant
List(localhost.Low)
Constant Type: Constant(1)
Literal:1
rhs type: Int(2)
Constant Type: Constant(2)
We have a literal constant
List(localhost.High)
Constant Type: Constant(2)
Literal:2
rhs type: Boolean(true)
Constant Type: Constant(true)
We have a literal constant
List(localhost.High)
Constant Type: Constant(true)
Literal:true
LEVEL: H
LEVEL: H
okay
LEVEL: H
okay
false
symboltable: Map(a -> 219 | Int | object TestIfConditionWithElseAccept2 | normalTermination | L, c -> 221 | Boolean | object TestIfConditionWithElseAccept2 | normalTermination | H, b -> 220 | Int | object TestIfConditionWithElseAccept2 | normalTermination | H)
pc: Set(L, H)
我只想将 pc: Set(L, H) 保存在输出文件中,而不是其余部分。借助哪个命令可以实现我的目标?
【问题讨论】: