I am not clear on best practice to execute unix commands from my scala based script.
A typical scala script is here
exec scala "$0" "$0" "$@"
println("args length is ", args.length)
### want to list all files in the underlying folder
val resultSet = "ls -la"????
Here's a simple script to get you started.
#!/usr/bin/env scala import scala.sys.process._ // args is auto-populated println("arg len = " + args.length) // get listing of current files val files: Array[String] = "ls -a".!!.split("\n") println("5th fiile is " + files(4)) System.exit(0)
Study the process package of the Standard Library for more on capturing process output, process exit status, pipelining, etc.