Executing OS Commands from Spring Shell

451 Views Asked by At

I'm using

org.springframework.shell:spring-shell-starter:2.0.0.RELEASE 

With gradle and Spring

My question is: Is there anyway to open vi or vim to edit a file in the OS from the shell?. if not what alternatives do I have to edit this file?

Regards

James

1

There are 1 best solutions below

1
On

I m not pretty sure with Spring, but with in Java you can, using ProcessBuilder and moreover it will help you to execute multiple command sets.

Quick look: https://www.geeksforgeeks.org/java-lang-processbuilder-class-java/