下面是我的脚本:
#!/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