January 2018
Intermediate to advanced
434 pages
14h 1m
English
Kotlin can also be used for writing shell scripts. A shell script has top-level executable code.
Kotlin script files have the .kts extension as opposed to the usual .kt for Kotlin applications.
To run a script file, just pass the -script option to the compiler:
$ kotlinc -script kotlin_script_file_example.kts
Read now
Unlock full access