现在的位置: 首页 > 综合 > 正文

Linux 和 Win 平台下的scala脚本

2013年06月07日 ⁄ 综合 ⁄ 共 368字 ⁄ 字号 评论关闭

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
::!#  

 

 


【上篇】
【下篇】

抱歉!评论已关闭.