簡體   English   中英

從Scala運行自定義外部命令

[英]Run custom external command from scala

我正在嘗試將火炬與scala集成在一起。

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

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

我嘗試在scala中執行它以獲得一些輸出:

"./foo.sh" !!

但是它給我一個錯誤:

第42行:th:找不到命令

有任何解決方法可以使此工作正常進行嗎?

我sugget補充完整路徑th

您是否安裝了割炬? 如果是,請嘗試以下操作:

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

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

type th

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM