无法通过期望接受输入并发送

时间:2018-07-11 06:44:15

标签: bash shell sh

我是DBA和Shell脚本的初学者。我创建了一个脚本来配置Oracle中的应用程序,但是它不接受输入和错误,如下所述。

#!/bin/bash
#!/usr/bin/expect
spawn perl /z00/comn/clone/bin/adcfgclone.pl appsTier /mnt/stage/clone/TEST_testin.xml 2>/dev/null

expect -exact "Enter the APPS password :\r"
send -- "testing@123\r"

expect -exact "Do you want to startup the Application Services for TEST? (y/n) [y] :\r"

send -- "n\r"
expect eof

输出错误:

expect: invalid option -- 'e'
usage: expect [-div] [-c cmds] [[-f] cmdfile] [args]
./apps_config.sh: line 43: send: command not found
couldn't read file "eof": no such file or directory

0 个答案:

没有答案