perl的expect发送特殊字符问题

项目里面用到expect登录一台主机

口令是BI_wgjk_#@!

  #$exp->send('BI_wgjk_#@!'."/n");    #错误
  #$exp->send('BI_wgjk_#/@!'."/n");  #正确
  $exp->send("BI_wgjk_#///@!/n");    #正确

可以看到expect对于perl的特殊字符@ 的处理,不是透明的

即使用了单引号也不行,必须加一次转义

如果用双引号,则需要转义2次

类似的还有$和%

 

注:

对expect/net::telnet的send/print和waitfor方法都是这样

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
PHP 手册 Mehdi Achour Friedhelm Betz Antony Dovgal Nuno Lopes Hannes Magnusson Georg Richter Damien Seguy Jakub Vrana 其他贡献者 2007-12-10 Philip Olson 中文翻译人员: 王远之 肖理达 肖盛文 黄啸宇 宋琪 陈伯乐 刘铭 © 1997-2007 PHP 文档组 版权信息 前言 入门指引 简介 简明教程 安装与配置 安装前需要考虑的事项 Unix 系统下的安装 Mac OS X 系统下的安装 Windows 系统下的安装 PECL 扩展库安装 还有问题? 运行时配置 语言参考 基本语法 类型 变量 常量 表达式 运算符 控制结构 函数 类与对象(PHP 4) 类与对象(PHP 5) Namespaces 异常处理 引用的解释 安全 简介 总则 以 CGI 模式安装时 以 Apache 模块安装时 文件系统安全 数据库安全 错误报告 使用 Register Globals 用户提交的数据 魔术引号 隐藏 PHP 保持更新 特点 用 PHP 进行 HTTP 认证 Cookie 会话 处理 XForms 文件上传处理 使用远程文件 连接处理 数据库永久连接 安全模式 PHP 的命令行模式 函数参考 .NET — .NET 函数 Apache — Apache 特有函数 APC — APC 可选 PHP 缓存 APD — APD 高级 PHP 调试器 Arrays — Array 数组函数 Aspell — Aspell 函数(已废弃) BBCode — BBCode Functions BC math — BC math 高精度数学函数 bcompiler — BCompiler PHP 字节码编译器 Bzip2 — Bzip2 压缩函数 Calendar — Calendar 日历函数 CCVS — CCVS API 函数(已废弃) Classes/Objects — Classes/Objects 类/对象函数 Classkit — Classkit 函数 ClibPDF — ClibPDF Functions [deprecated] COM — COM 和 .Net(Windows)函数 Crack — Crack Functions ctype — Character Type Functions CURL — CURL, Client URL Library Functions Cybercash — Cybercash Payment Functions CyberMUT — Credit Mutuel CyberMUT functions Cyrus IMAP — Cyrus IMAP administration Functions Date/Time — Date/Time 日期/时间函数 DB++ — DB++ Functions dba — Database (dbm-style) Abstraction Layer Functions dBase — dBase Functions DBM — DBM Functions [deprecated] dbx — dbx Functions Direct IO — Direct IO Functions Directories — Directory 目录函数 DOM — DOM Functions DOM XML — DOM XML Functions enchant — enchant Functions Errors and Logging — Error Handling and Logging Functions Exif — Exif Functions ExpectExpect Functions fam — File Alteration Monitor Functions FDF — Forms Data Format Functions Fileinfo — Fileinfo Functions filePro — filePro Functions Filesystem — Filesystem 文件系统函数 Filter — Filter Functions Firebird/InterBase — Firebird/InterBase Functions Firebird/Interbase (PDO) — Firebird/Interbase Functions (PDO_FIREBIRD) FriBiDi — FriBiDi Functions FrontBase — FrontBase Functions FTP — FTP 函数 Function handling — Function Handling Functions GeoIP — GeoIP Functions gettext — Gettext Functions GMP — GMP Functions gnupg — gnupg 函数 gopher — Net_Gopher haru — Haru PDF Functions hash — hash Functions HTTP — HTTP 函数 Hyperwave — Hyperwave Functions Hyperwave API — Hyperwave API Functions i18n — i18n 函数 IBM (PDO) — IBM Functions (PDO_IBM) ibm_db2 — IBM DB2, Cloudscape and Apache Derby Functions iconv — iconv Functions id3 — ID3 Functions IIS Functions — IIS Administration Functions Image — Image 图像函数 Imagick Image Library IMAP — IMAP, POP3 and NNTP Functions Informix — Informix Functions Informix (PDO) — Informix Functions (PDO_INFORMIX) Ingres II — Ingres II Functions IRC Gateway — IRC Gateway Functions Java — PHP / Java Integration JSON — JSON 函数 kadm5 — KADM5 LDAP — LDAP Functions libxml — libxml Functions Lotus Notes — Lotus Notes Functions LZF — LZF Functions Mail — Mail 邮件函数 Mailparse — Mailparse Functions Math — Math 数学函数 MaxDB — MaxDB PHP Extension MCAL — MCAL Functions mcrypt — Mcrypt Encryption Functions MCVE — MCVE (Monetra) Payment Functions Memcache — Memcache Functions mhash — Mhash Functions Mimetype — Mimetype Functions Ming (flash) — Ming functions for Flash Misc. — Miscellaneous Functions mnoGoSearch — mnoGoSearch Functions MS SQL Server — Microsoft SQL Server Functions MS SQL Server (PDO) — Microsoft SQL Server and Sybase Functions (PDO_DBLIB) Msession — Mohawk Software Session Handler Functions mSQL — mSQL Functions Multibyte String — Multibyte String Functions muscat — muscat Functions MySQL — MySQL 函数 MySQL (PDO) — MySQL Functions (PDO_MYSQL) mysqli — MySQLi 扩展库 Ncurses — Ncurses Terminal Screen Control Functions Network — Network Functions Newt — Newt Functions NSAPI — NSAPI-specific Functions Object Aggregation — Object Aggregation/Composition Functions Object overloading — Object property and method call overloading OCI8 — Oracle 函数 ODBC — ODBC Functions (Unified) ODBC and DB2 (PDO) — ODBC and DB2 Functions (PDO_ODBC) OGG/Vorbis — oggvorbis openal — OpenAL Audio Bindings OpenSSL — OpenSSL Functions Oracle — Oracle 函数(已废弃) Oracle (PDO) — Oracle Functions (PDO_OCI) Output Control — Output Control 输出控制函数 OvrimosSQL — Ovrimos SQL Functions Paradox — Paradox File Access Parsekit — Parsekit Functions PCNTL — Process Control Functions PCRE — Perl 兼容正则表达式函数 PDF — PDF 函数 PDO — PDO Functions phar — Phar archive stream and classes PHP Options/Info — PHP Options&Information POSIX — POSIX Functions POSIX Regex — POSIX 扩展正则表达式函数 PostgreSQL — PostgreSQL 数据库函数 PostgreSQL (PDO) — PostgreSQL Functions (PDO_PGSQL) Printer — Printer Functions Program Execution — Program Execution Functions PS — PostScript document creation Pspell — Pspell Functions qtdom — qtdom Functions radius — Radius Rar — Rar Functions Readline — GNU Readline Recode — GNU Recode Functions RPMReader — RPM Header Reading 函数 runkit — runkit Functions SAM — SAM - Simple Asynchronous Messaging Satellite — Satellite CORBA client extension [deprecated] SCA — SCA Functions SDO — SDO Functions SDO DAS XML — SDO XML Data Access Service Functions SDO-DAS-Relational — SDO Relational Data Access Service Functions Semaphore — Semaphore, Shared Memory and IPC Functions SESAM — SESAM Database Functions Session PgSQL — PostgreSQL Session Save Handler Sessions — Session 会话处理函数 shmop — Shared Memory Functions SimpleXML — SimpleXML functions SNMP — SNMP 函数 SOAP — SOAP Functions Sockets — Socket Functions SPL — Standard PHP Library (SPL) Functions SQLite — SQLite Functions SQLite (PDO) — SQLite Functions (PDO_SQLITE) ssh2 — Secure Shell2 Functions Statistics — Statistics Functions Streams — Stream Functions Strings — String 字符串处理函数 SVN — Subversion 函数 SWF — Shockwave Flash Functions swish — Swish Functions Sybase — Sybase Functions TCP Wrappers — TCP Wrappers Functions tidy — Tidy Functions Tokenizer — Tokenizer Functions Unicode — Unicode Functions URLs — URL 函数 Variables — Variable 变量函数 Verisign Payflow Pro — Verisign Payflow Pro Functions vpopmail — vpopmail Functions W32api — W32api 函数 WDDX — WDDX Functions win32ps — win32ps Functions win32service — win32service Functions xattr — xattr Functions xdiff — xdiff Functions XML — XML 语法解析函数 XML-RPC — XML-RPC 函数 XMLReader — XMLReader functions XMLWriter — XMLWriter Functions XSL — XSL functions XSLT — XSLT Functions YAZ — YAZ Functions YP/NIS — YP/NIS Functions Zip — Zip File Functions Zlib — Zlib Compression Functions PHP at the Core: A Hacker's Guide to the Zend Engine The PHP 5 build system Extension structure Memory management Working with variables Writing functions Working with classes and objects Working with resources Working with INI settings Working with streams PDO Driver How-To Extension FAQs Zend Engine 2 API reference Zend Engine 1 The future: PHP 6 and Zend Engine 3 FAQ — FAQ:常见问题 一般信息 邮件列表 获取 PHP 数据库问题 安装 — 安装常见问题 编译问题 使用 PHP PHP 和 HTML PHP 和 COM PHP 和其它语言 从 PHP/FI 2 移植到 PHP 3 从 PHP 3 移植到 PHP 4 从 PHP 4 移植到 PHP 5 杂类问题 附录 PHP 及其相关工程的历史 Migrating from PHP 5.1.x to PHP 5.2.x Migrating from PHP 5.0.x to PHP 5.1.x 从 PHP 4 移植到 PHP 5 从 PHP 3 移植到 PHP 4 从 PHP/FI 2 移植到 PHP 3 PHP 的调试 配置选项 php.ini 配置选项 所支持时区列表 扩展库分类 函数别名列表 保留字列表 资源类型列表 支持的协议/封装协议列表 可用过滤器列表 所支持的套接字传输器(Socket Transports)列表 PHP 类型比较表 解析器代号列表 Userland Naming Guide 关于本手册 开放出版许可协议 函数索引 补充说明
I. 简介 1. 简介 如何构建一个 LFS 系统? 与上一版本有何不同? 更新日志 资源 帮助 II. 构建前的准备工作 2. 准备一个新分区 简介 创建一个新分区 在新分区上创建文件系统 挂载新分区 3. 软件包和补丁 简介 全部软件包 需要的补丁 4. 最后的准备工作 关于环境变量 $LFS 创建 $LFS/tools 目录 添加 LFS 用户 设置工作环境 关于 SBU 关于软件包测试套件 5. 构建临时编译环境 简介 工具链技术说明 Binutils-2.16.1 - 第一遍 GCC-4.0.3 - 第一遍 Linux-Libc-Headers-2.6.12.0 Glibc-2.3.6 调整工具链 Tcl-8.4.13 Expect-5.43.0 DejaGNU-1.4.4 GCC-4.0.3 - 第二遍 Binutils-2.16.1 - 第二遍 Ncurses-5.5 Bash-3.1 Bzip2-1.0.3 Coreutils-5.96 Diffutils-2.8.1 Findutils-4.2.27 Gawk-3.1.5 Gettext-0.14.5 Grep-2.5.1a Gzip-1.3.5 M4-1.4.4 Make-3.80 Patch-2.5.4 Perl-5.8.8 Sed-4.1.5 Tar-1.15.1 Texinfo-4.8 Util-linux-2.12r 清理系统 改变所有者 III. 构建 LFS 系统 第六章 安装系统基础软件 简介 挂载虚拟内核文件系统 包管理 进入 Chroot 环境 创建系统目录结构 创建必需的文件与符号连接 Linux-Libc-Headers-2.6.12.0 Man-pages-2.34 Glibc-2.3.6 再次调整工具链 Binutils-2.16.1 GCC-4.0.3 Berkeley DB-4.4.20 Coreutils-5.96 Iana-Etc-2.10 M4-1.4.4 Bison-2.2 Ncurses-5.5 Procps-3.2.6 Sed-4.1.5 Libtool-1.5.22 Perl-5.8.8 Readline-5.1 Zlib-1.2.3 Autoconf-2.59 Automake-1.9.6 Bash-3.1 Bzip2-1.0.3 Diffutils-2.8.1 E2fsprogs-1.39 File-4.17 Findutils-4.2.27 Flex-2.5.33 GRUB-0.97 Gawk-3.1.5 Gettext-0.14.5 Grep-2.5.1a Groff-1.18.1.1 Gzip-1.3.5 Inetutils-1.4.2 IPRoute2-2.6.16-060323 Kbd-1.12 Less-394 Make-3.80 Man-DB-2.4.3 Mktemp-1.5 Module-Init-Tools-3.2.2 Patch-2.5.4 Psmisc-22.2 Shadow-4.0.15 Sysklogd-1.4.1 Sysvinit-2.86 Tar-1.15.1 Texinfo-4.8 Udev-096 Util-linux-2.12r Vim-7.0 关于调试符号 再次清理系统 最终的清理 7. 配置系统启动脚本 简介 LFS-Bootscripts-6.2 启动脚本是如何工作的? LFS 系统的设备和模块处理 配置 setclock 脚本 配置 Linux 控制台 配置 sysklogd 脚本 创建 /etc/inputrc 文件 Bash Shell 启动文件 配置 localnet 脚本 定制 /etc/hosts 文件 为设备创建惯用符号连接 配置网络脚本 8. 使 LFS 系统能够启动 简介 创建 /etc/fstab 文件 Linux-2.6.16.27 使 LFS 系统能够启动 9. 结束 结束 看看你是第几个? 重启系统 现在做什么?

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值