我在寻求帮助,以便在 ubuntu 的终端中填写登录详细信息。我有一个脚本 test.sh,运行时会在终端中提示输入以下详细信息
Enter Auth Username:
username
Enter Auth Password:
password
我想自动填写详细信息(用户名和密码)的过程。我在线查看并找到了以下脚本:
#!/bin/sh
spawn test.sh
expect {
Enter Auth Username: { send "username\r"; exp_continue }
}
expect {
Enter Auth Password: { send "password\r" }
}
当我运行上述脚本时,出现以下错误
./test.sh: 3: ./test.sh: spawn: not found
couldn't read file "{": no such file or directory
./test.sh: 5: ./test.sh: Enter: not found
./test.sh: 5: ./test.sh: exp_continue: not found
./test.sh: 6: ./test.sh: Syntax error: "}" unexpected
非常感谢您抽出时间。问候