2012-11-23 250 views
0

上執行命令我有Linux的腳本和兩個不同的Solaris機器,一個是ISO-8859-1另一個是UTF-8不能遠程計算機

當我和UTF-8運行它,它工作正常,但與ISO我得到一個錯誤:

我需要如何執行它。

如果我coppy我scrit與Solaris有異,並執行那裏做工精細沒有錯誤

我的執行代碼:

using (var sftp = new Sftp()) 
{ 
    try 
    { 
     sftp.Connect(target.FullyQualifiedDomainName); 
     sftp.Authenticate(target.UserName, crypto.TwoWayDecrypt(target.Password)); 
     sftp.Put(AssemblyDirectory + "\\Scripts\\solaris_perf_data.sh", "perf_data.sh", CopyMode.Copy); 
    } 
    finally 
    { 
     sftp.Close(); 
    } 
} 

ssh.Execute(chModCommand); 

//error here 
result = ssh.Execute(executeCommand).ToString();   

我得到的錯誤是:

copying script file and executing script on host Solaris 10 region settings 
(france). Error Message: System.IO.IOException: ./perf_data.sh[5]: 
TotSize==+utilisés,: numéro incorrect at Dart.Ssh.Ssh.Execute(String command, 
Object state) at Virtustream.CAS.DataCollector.Library.DataCollectors.SolarisDataCollector.GetDat‌​a(Boolean 
isInventory, String subject, String executeCommand) 
+1

你得到的錯誤是什麼? –

+0

@sudo_O在主機Solaris 10區域設置(法國)上覆制腳本文件並執行腳本時出錯。錯誤消息:System.IO.IOException:./perf_data.sh[5]:TotSize == +utilisés,:num_root Virtustream.CAS.DataCollector.Library上的Dart.Ssh.Ssh.Execute(字符串命令,對象狀態)不正確.DataCollectors.SolarisDataCollector.GetData(布爾isInventory,字符串主題,字符串executeCommand) – user1406855

+0

這裏我執行iso,在相同的只有改變utf-8它工作正常 – user1406855

回答

0

要麼在腳本中編碼特定字符(通常在註釋:-D中),要麼在機器上沒有相同的權限

+0

@ okie0th沒有我沒有具體的,因爲如果我在遠程mashine腳本coppy腳本執行的地方它工作正常 – user1406855

+0

@ user1406855 ssh可以重置(或不) - 有時與膩子相關的問題 - 遠程機器上的語言環境。什麼是 SSH區域 – OkieOth

+0

@ Okie0th#語言環境的輸出 LANG = LC_CTYPE = fr_FR.ISO8859-1 LC_NUMERIC = fr_FR.ISO8859-1 LC_TIME = fr_FR.ISO8859-1 LC_COLLATE = fr_FR.ISO8859-1 LC_MONETARY = fr_FR.ISO8859-1 LC_MESSAGES = fr LC_ALL = – user1406855