Linux 和 Win 平台下的scala脚本

Linux 平台下

 文件名: scala_exec

#!/bin/sh
exec scala "$0" "$@"
!#

// The following should be scala code
// just an example
println("I'm executing in bash, and you input args.." + args[0])  

 和bash脚本一样,#!/bin/sh必需是文件开头的第一行。 

 然后赋予该脚本可执行权限:

chmod u+x scala_exec

 这样你就可以在Linux上像执行shell脚本一样地执行scala脚本了。

./scala_exec "hello"

 

Windows 平台下

 文件名:scala_exec.bat

::#!
@echo off
call scala %0 %*
goto :eof
::!#  

 

 


posted on 2012-04-02 10:13  CodingME!  阅读(1963)  评论(0编辑  收藏  举报

导航

Blog