2016-08-18 46 views
0

我正在嘗試整合torch與scala。從scala運行自定義外部命令

我有以下bash腳本(foo.sh):

#!/bin/bash 
echo hello world 
th *rest of command* 

,我嘗試在斯卡拉執行它得到一些輸出:但是它給了我一個錯誤

"./foo.sh" !! 

line 42: th: command not found

是否有任何解決方法可以使此工作?

+2

我建議添加'th'的完整路徑。 – Cyrus

+1

@Cyrus聖莫莉,我花了太多的時間來得到這個工作。如果你發佈這個答案,我會接受。 – carpenter

回答

1

我建議您將完整路徑添加到th

0

你有沒有安裝火炬? 如果是的話,試試這個:

#!/bin/bash 
source ~/.profile 
source ~/.bashrc 
echo hello world 
th *rest of command* 

或更好的完整路徑運行th。完整路徑可以通過命令獲得:

type th