我想了解这个斯卡拉脚本是如何工作的:在sh/Bash shell脚本中,##(bang-pound)是什么意思?
#!/usr/bin/env bash
exec scala "$0" "[email protected]"
!#
object HelloWorld {
def main(args: Array[String]) {
println("Hello, world! " + args.toList)
}
}
HelloWorld main args
在第3行,什么是 “#!” 在干什么?然后将文件的剩余部分提供给Scala程序的standard input?另外,'!#'记录在任何地方?
NB:我能找到最近的事情,虽然这是不以任何方式直接相关的是堆栈溢出问题Why do you need to put #!/bin/bash at the beginning of a script file?(约Bash脚本的开始)。
Windows版本的这个问题:http://stackoverflow.com/questions/6671913/scala-scripts-in-windows-batch-files – 2012-04-08 22:58:14