Forum Discussion
that was for windows how about MAC?
Try changing first line to:
def command = ["/bin/sh", "csvtojson", "/tmp/mydata.csv"]
if your shell is bash - use "/bin/bash"
- zsousa8 years agoContributor
ok, I have the below code now but what is the equivalent of Runtime on unix ?
String command = ["/bin/bash", "/Users/zsousa/APIDevelopment/apitests/node-csvtojson-master/temp/runGroovy1.groovy"]
Process child = Runtime.getRuntime().execute(command)
//InputStream in1 = child.getInputStream()
//def json = in1.text
//in1.close()
//child.waitFor()
//log.info json- nmrao8 years agoChampion Level 3Sorry, you did not tell what happened. Will you?
In order to run a groovy script, what is it to do with Runtime on Unix?- zsousa8 years agoContributor
String command = ["/bin/bash", "csvtojson","csvdata_csv.csv"]Process child = Runtime.getRuntime().exec(command)
I get below
Thu Jun 23 16:25:56 EDT 2016:ERROR:An error occurred [Cannot run program "[/bin/bash,": error=2, No such file or directory], see error log for details