预期整数但在语句 match_max -d 1000000000 -i $chassis_spwan_id 中得到 "match_max"

expected integer but got "match_max" in statement match_max -d 1000000000 -i $chassis_spwan_id

我的这行代码出现以下错误,我们最近进行了 linux 升级,似乎 TCl 或 EXPECT 包中发生了一些变化,早些时候这段代码用于我的脚本 -

代码-

match_max -d 1000000000 -i $chassis_spwan_id

错误

expected integer but got "match_max" in statement match_max -d 1000000000 -i $chassis_spwan_id

我注意到如果我只给出 match_max -d 1000000000 代替 match_max -d 1000000000 -i $chassis_spwan_id 就可以了。

如果有人知道这个问题,请告诉我。

我的 TCL 是 8.5,expect 是 5.44.1.15,我的 rhel 是 6.2。

  1. 你需要在命令末尾加上1000000000。首先是标志,然后是参数。

match_max -i $chassis_spwan_id 1000000000

  1. 我认为你不能同时使用 -d 和 -i。

match_max 应该这样使用:

# get current buffer size
match_max [−i spawn_id]

# set to the default size (2000 bytes)
match_max −d [−i spawn_id]

# set to the specified size
match_max [−i spawn_id] size

您的 match_max -d 1000000000 并没有像您预期的那样真正工作。实际上值 1000000000 被忽略了。