i am new at scala and i am trying to run this simple program that get input from the user and execute it in the operation system:
import scala.io._
import sys.process._
object MyCmd {
def main(args: Array[String]) = {
print("> ")
var inputString = StdIn.readLine()
while(!inputString.trim().equals("exit")) {
var proc = stringToProcess(inputString)
println( proc.!!)
print("> ")
inputString = StdIn.readLine()
}
}
}
but when i'm running it:
c:\IDE\scala\test>scala MyCmd
> dir
java.io.IOException: Cannot run program "dir": CreateProcess error=2, The
system cannot find the file specified
...
Any help will be much appreciate