下面我有一個簡單的shell腳本:「readOnly的」和執行shell腳本時,沒有發現其他符號遠程
#!/bin/bash
# Hadoop Clear
readOnly hadoop = /opt/hadoop/bin/hadoop
hadoop fs -rm -r/
當我運行在同一臺機器上的終端腳本,一切工作沒有錯誤。 現在,我想遠程調用這個腳本。所以從我的java
程序,我做了ssh
到服務器,並調用腳本爲: sh <full Path to script>
。
我得到一個錯誤說:
clearHadoop.sh: readOnly: not found
clearHadoop.sh: hadoop not found
任何想法,爲什麼出現這種情況?
我首先在機器A上運行shell腳本。然後我在同一臺機器A上運行相同的腳本,但我從機器B調用腳本.A中有hadoop,readOnly是一個shell關鍵字,所以我不認爲這是問題 – Aneesh 2015-03-02 13:28:11