实战演练

  • \n回车
"1\nhello\n"

工作原理

  • \n回车
[root@shaofeng rename]# echo -e "1\nhello\n" | ./interactive.sh
YOu have eentered 1 hello
  • echo -e来生成输入序列
[root@shaofeng rename]# echo -e "1\nhello\n" > input.data
[root@shaofeng rename]# cat input.data
1
hello

补充内容

expect

results matching ""

    No results matching ""