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

 

 


相关文章:

  • 2021-11-28
  • 2021-12-24
  • 2021-09-30
  • 2021-05-19
  • 2021-08-31
猜你喜欢
  • 2021-06-16
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2021-10-31
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案