简体   繁体   English

bash脚本-使用Expect而无需plot命令来显示

[英]bash script - use expect without plot command to screen

i'm new with expect. 我是新来的期望。 i wanted to ask how can i execute a command but without plot to the screen the command itself. 我想问我如何执行命令,但又没有在屏幕上显示命令本身。

for example: 例如:

expect "*?>"
send "echo done"
expect "*?>"

without plotting to the screen "echo done" but ONLY "done". 而不会在屏幕上绘制“回声完成”,而只是“完成”。

Thank you. 谢谢。

Try something like this: 尝试这样的事情:

if {[info exists tty_spawn_id]} {
    stty -echo
}

log_user 0

...

send_user "done"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM