使用Linux shell,如何从当前工作目录启动具有不同工作目录的程序?
例如,我有一个二进制文件helloworld,hello-world.txt在当前目录中创建该文件.该文件位于目录中/a.目前我在目录中/b.我想启动我的程序运行../a/helloworld并hello-world.txt在第三个目录中的某个位置/c.
我尝试使用sbt启动器版本0.12.1使用CLI参数运行我的scala项目.从scala提示符运行时它可以正常工作:
$ sbt
[info] (...)
> run sth
(...)
[success] Total time: 0 s, completed Nov 9, 2012 3:04:47 PM
Run Code Online (Sandbox Code Playgroud)
但是当我想从shell运行它时,根据这个答案,例如,我收到一个错误:
$ sbt "run sth"
[info] (...)
you need to provide source file name
[success] Total time: 0 s, completed Nov 9, 2012 3:07:07 PM
[error] Not a valid command: sth (similar: set, last, shell)
[error] Expected '/'
[error] Expected ':'
[error] Not a valid key: sth (similar: test, state, watch)
[error] sth
[error] ^
Run Code Online (Sandbox Code Playgroud)
并且我的scala项目给出了"您需要提供源文件名"信息,以指示main没有获得任何CLI参数.
它是在先前版本的sbt中工作的(在引用的问题中),还是我做错了什么?