carpenter carpenter - 3 months ago 7
Scala Question

Run custom external command from scala

I am trying to integrate torch, with scala.

I have following bash script (foo.sh):

#!/bin/bash
echo hello world
th *rest of command*


and I try to execute it in scala to get some output:

"./foo.sh" !!


However it gives me an error:


line 42: th: command not found


Is there any workaround to get this working?

Answer

I sugget to add full path to th.