Skip to content

jakubriegel/kshell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

kshell

Runner for sh.kts scripts

To learn more about Kotlin Shell check here

get it

To run kshell you need kotlin-shell-core and kotlin-shell-kts as well as kotlinc installed.

Packages with libraries can be found in this repository releases.

run

Kotlin Shell scripts have .sh.kts extension

command line

To run type:

kshell SCRIPT.sh.kts ARGS

example:

kshell hello.sh.kts
kshell greeting.sh.kts John

shebang

Add kshell to PATH and #!/usr/bin/env kshell at the begining of a script file to be able to use it as executable.

example: hello.sh.kts

#!/usr/bin/env kshell
shell { "echo hello world!"() } 
$ export PATH=$PATH:path/to/kshell
$ chmod +x hello.sh.kts
$ ./hello.sh.kts
hello