小编Ris*_*abh的帖子

在期望脚本中从用户读取变量

下面是我的脚本:

#!/usr/bin/expect
echo "enter unique id" 
read test
mkdir -p  /evoting_test/$test
        spawn scp -r abc@10.150.10.104:/shareddata/was/l1/*.pdf /rishabh/$test/
        set pass "abc123"
        expect {
                password: {send "$pass\r"; exp_continue}
                }
Run Code Online (Sandbox Code Playgroud)

我收到错误:

invalid command name "echo"
    while executing
"echo "enter uNIQUE id" "
    (file "./scp_test.sh" line 2)
Run Code Online (Sandbox Code Playgroud)

它不是从用户读取变量并在命令中使用该变量

expect

1
推荐指数
1
解决办法
5123
查看次数

标签 统计

expect ×1