代码之家  ›  专栏  ›  技术社区  ›  munish

在spawing ssh之后或之前指定match_max有什么区别?

  •  0
  • munish  · 技术社区  · 12 年前
    # match_max 1000000000
      set timeout 60
      spawn ssh -o "StrictHostKeyChecking no" "$username@$hostname"
      match_max 1000000000
    

    如果在我使用ssh之前给出了match_max选项,那么我不会将完整的输出输入 expect_out(buffer) 但如果我在SSH之后给出相同的东西,我会得到正确的结果。

    此外,如果我在第一种情况下使用-d选项,我会得到完整的输出。为什么?

    此外,我如何检查为我的Linux系统设置了多少缓冲区?我在找 limit 命令,但找不到。

    1 回复  |  直到 12 年前
        1
  •  1
  •   devnull    12 年前

    有关的预期的手册页 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 未指定)。