想要在双引号内使用双引号 [英] Want to use double quote inside a double quote

查看:207
本文介绍了想要在双引号内使用双引号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

#!/opt/sfw/bin/expect --
spawn telnet -e ! [lindex $argv 0]
expect "<"
send "ACT-USER::ABCDEFG:123::\"ABCD\";"

由于双引号内的双引号,以上操作均未给出错误

Above is not working giving error due to double quote inside a double quote

错误:

    spawn telnet -e !
Telnet escape character is '!'.
invalid flags
send: spawn id exp7 not open
    while executing
"send "ACT-USER::ABCDEFG:123::'\"ABCD\"';""
    (file "./get-amp-pms.sh" line 4)


推荐答案

使用大括号代替发送的双引号,如下所示:

Use curly braces instead of the double quotes for the send, as follows:

send {ACT-USER::ABCDEFG:123::"ABCD";}

这篇关于想要在双引号内使用双引号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆