2013-04-08 68 views
0
# match_max 1000000000 
    set timeout 60 
    spawn ssh -o "StrictHostKeyChecking no" "[email protected]$hostname" 
    match_max 1000000000 

如果我在使用ssh之前給出了match_max選項,我沒有得到完整的輸出到expect_out(buffer),但是如果我在SSH之後給出同樣的結果,我會得到正確的結果。在spawn ssh之後或之前指定match_max時,它會有什麼不同?

此外,如果我在第一種情況下使用-d選項,我會得到完整的輸出。爲什麼?

另外,如何檢查爲我的Linux系統設置了多少緩衝區?我查找了limit命令,但找不到它。

回答

1

的手冊頁想到關於match_max命令讀取

match_max [-d] [-i spawn_id] [size] 
defines the size of the buffer (in bytes) used internally by expect. With no size argument, the current size is returned. With the -d flag, the default size is set. (The initial default is 2000.) With the -i flag, the size is set for the named spawn id, otherwise it is set for the current process. 

這是您看到的是什麼(因爲沒有指定-i的)。

相關問題