Issuing native system commands in Scala

前端 未结 5 772
长情又很酷
长情又很酷 2021-02-01 16:42

I want to issue a native system command from a Scala program, and perhaps trap the output. (\"ls\" comes to mind. There may be other ways to get directory information without is

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-01 17:19

    import scala.sys.process._
    
    val vimLocation: String = "whereis vim" !!
    

    reference

提交回复
热议问题