import scala.sys.process._
val command = … // lftp command
val output = command.!!
It throws an error message “open: unrecognized option ‘–verbose’”. In python this can be overcame by communicate function. How can I achieve this in Scala?
You can invoke the “.!!” method on a plain string, which will do very simplistic parsing of the string into command and arguments (i.e. split it on any whitespace, without any regard to quotes/backslashes/whatever) - or you can do the splitting yourself: