Preface this by saying I'm entirely new to Kotlin but it's time that I start understanding this thing.
I have a command that I run in powershell.
kubectl get pods -o jsonpath='{range .items[*]}{.spec.containers[].image}{\"\n\"}{end}'
I want to create a kotlin script to run that command and then parse the output in kotlin as a string using something in kotlin like a Java string tokenizer.
At this stage I'm using kotlin scripting and have a basic hello world working like below. The only reason I'm listing this in the question is bc I want to stick to a simple kotlin script and want to make that clear:
println("Called with args:")
args.forEach {
println("- $it")
}
RUN AND OUTPUT OF SCRIPT
kotlinc -script .\helloScript.kts hello
Called with args:
- hello
Can someone help me with how this might be best coded in Kotlin script? I've done some research but am finding it hard to find the right example that suits what i'm after.
thanks!