scala脚本的执行

test.sh

#!/bin/sh -e

export JAVA_OPTS="-Xms4G -Xmx8G"
JAVA_HOME=/atmd/jdk
SCALA_HOME=/atmd/etltasks/gmd/chline2.0/scala

scala  -classpath "\
:/atmd/etltasks/gmd/chline2.0/lib/c3p0-0.9.5.jar\
:/atmd/etltasks/gmd/chline2.0/lib/gson-2.8.2.jar\
:/atmd/etltasks/gmd/chline2.0/lib/jackson-annotations-2.9.4.jar\
:/atmd/etltasks/gmd/chline2.0/lib/jackson-core-2.9.5.jar\
:/atmd/etltasks/gmd/chline2.0/lib/jackson-databind-2.9.5.jar\
:/atmd/etltasks/gmd/chline2.0/lib/jackson-module-paranamer-2.9.5.jar\
:/atmd/etltasks/gmd/chline2.0/lib/jackson-module-scala_2.11-2.9.5.jar\
:/atmd/etltasks/gmd/chline2.0/lib/mchange-commons-java-0.2.6.jar\
:/atmd/etltasks/gmd/chline2.0/lib/mysql-connector-java-5.1.42.jar\
:/atmd/etltasks/gmd/chline2.0/lib/paranamer-2.8.jar" chline.scala $DATE

在scala命令行里,遇到问题,了,怎么办?

:he

:help

以上3个形式,都可以,之后会显示出相关的操作命令,我用的最多的是:paste,此命令可以将在文本中写好的命令,一并粘贴复制到命令行里,输入完成后,按ctrl+d则会执行返回到scala命令行里

 

将操作成功的都保存到指定文件
scala> :save /atmd/etltasks/gmd/chline2.0/iamatest
scala> :quit  退出

 

你可能感兴趣的:(scala)