https://github.com/jakubriegel/kshell
Runner for Kotlin shell scripts
https://github.com/jakubriegel/kshell
kotlin script shell
Last synced: 3 months ago
JSON representation
Runner for Kotlin shell scripts
- Host: GitHub
- URL: https://github.com/jakubriegel/kshell
- Owner: jakubriegel
- License: apache-2.0
- Created: 2019-08-09T12:06:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-08-30T14:22:13.000Z (over 6 years ago)
- Last Synced: 2025-02-01T23:41:55.014Z (about 1 year ago)
- Topics: kotlin, script, shell
- Language: Shell
- Homepage: https://github.com/jakubriegel/kotlin-shell
- Size: 7.81 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# kshell
Runner for `sh.kts` scripts
To learn more about Kotlin Shell check [here]("https://github.com/jakubriegel/kotlin-shell")
## 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:
```shell
kshell SCRIPT.sh.kts ARGS
```
example:
```shell
kshell hello.sh.kts
```
```shell
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_
```shell
#!/usr/bin/env kshell
shell { "echo hello world!"() }
```
```shell
$ export PATH=$PATH:path/to/kshell
$ chmod +x hello.sh.kts
$ ./hello.sh.kts
hello
```