How to set environmental variable from Scala?

前端 未结 2 588
迷失自我
迷失自我 2020-12-18 00:02

I need to set environmental variable (PATH) from Scala.

I tried this:

val cmd = Seq(\"export\", \"PATH=\'bla\'\")
cmd.lines

but I g

2条回答
  •  一个人的身影
    2020-12-18 00:18

    'export' isn't an executable, it's a shell built-in command. If you're trying to set the path in the parent shell, well, you can't. You can set it for a new shell that you execute. This is really more of a unix FAQ.

提交回复
热议问题