---
title: "expect使用注意情况"
author: "shicheng"
date: "2011-10-13T15:39:39Z"
tags: []
categories: ["编程语言"]
slug: "expect"
draft: false
lastmod: "2011-10-13T15:39:39Z"
id: 1194626
url: "https://benchild.iteye.com/blog/1194626"
---

1。设置超时时间，如果网速原因，可能会无法正确返回结果

set timeout 10

2。设置缓冲大小，如果返回的数据量比较大（默认是2000），

set match\_max 640000

3。如果要往远程发送特殊字符，要进行转换

如：[,},\\等

否则会报类似如下的错误

invalid command name "/-/"

    while executing

"/-/"

    invoked from within