2013-10-05 47 views
2

代碼:的elisp如何將其退出之前飼料與流程發送字符串命令子進程

(progn 
    (start-process "my-process" "my-process-output" "bash") 
    (process-send-string "my-process" "ls -al ~")) 

當跑了,我只得到了

bash-3.2$ 

有「我的進程」前終止「過程發送字符串」?我的目標不是特別指揮一個「bash」過程。它實際上更通用 - 那就是使用process-send-string將命令提供給現有的子進程。我試圖通過nil參數來啓動進程,希望emacs以某種方式在我傳遞給任何具體參數之前以某種方式爲我啓動一個進程地址持有者,但這也沒有幫助。

(progn 
    (start-process "my-process" "my-process-output" nil) 
    (process-send-string "my-process" "bash -c \"ls -al ~\"")) 

這樣做的方法是什麼?

回答

2

以新行嘗試(按輸入)輸入您ls命令後:

(process-send-string "my-process" "ls -al ~\n"))