在Scala中,是否可以编写引用另一个脚本的脚本 [英] In Scala, is it possible to write a script which refers to another script
问题描述
我目前正在考虑使用Scala脚本来控制MySQL数据库的生命周期,而不是使用MS-DOS脚本(我在Windows XP上)。
I am currently looking at using Scala scripts to control the life-cycle of a MySQL database instead of using MS-DOS scripts (I am on Windows XP).
我想要一个只保存配置信息的配置脚本,以及一个或多个使用配置信息执行各种操作的管理脚本,如启动,停止,显示状态等.....
I want to have a configuration script which only holds configuration information, and 1 or more management scripts which use the configuration information to perform various operations such as start, stop, show status, etc .....
是否可以编写包含/ imports / references另一个Scala脚本的Scala脚本?
Is it possible to write a Scala script which includes/imports/references another Scala script?
我看了一下scala解释器的-i选项,但这启动了一个不是我想要的交互式会话。
I had a look at the -i option of the scala interpreter, but this launches an interactive session which is not what I want.
推荐答案
我使用进程并像调用其他任何命令一样调用其他Scala脚本。
I'd use Process and call the other Scala script just like any other command.
这篇关于在Scala中,是否可以编写引用另一个脚本的脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!