adept7771 |
04-17-2017 03:01 AM |
Expect package - quotes interrupt running of scripts
Hello community! I have installed Expect package for my debian server and it's work perfectly but i faced with one problem. Single quotes in Expect sripts all time interrupts running of script.
My example:
Code:
#!/bin/bash
#!/bin/expect
expect << END
spawn aptitude install MDS
expect "Accept this solution?" {send "n\r"}
expect "Accept this solution?" {send "Y\r"}
expect "Do you want to*" {send "Y\r"}
expect "To continue, enter*" {send "Yes\r"}
expect "To continue, enter*" {send "Yes\r"}
expect "Enter metadata_manager database name (leave blank for default \\'metadata_manager\\')\:" {send "metadata_manager\r"}
expect "Enter metadata_manager database username*" {send "\r"}
expect "Enter password:" {send "123\r"}
expect "Confirm password:" {send "123\r"}
expect "Installation can take some minutes*" {send "\r"}
expect "Enter the current IP address:" {send "10.130.139.114\r"}
expect "Do you want to use current ip*" {send "Y\r"}
expect "Enter the metadata enhancer address:" {send "127.0.0.1\r"}
expect "Enter account_manager database name*" {send "\r"}
expect "Enter account_manager database username*" {send "\r"}
expect "Enter password:" {send "123\r"}
expect "Confirm password:" {send "123\r"}
expect "Installation can take some minutes*" {send "\r"}
expect "Username*" {send "\r"}
expect "Email address:" {send "\r"}
expect "Password*" {send "1q2w3eGSV\r"}
expect "Password*" {send "1q2w3eGSV\r"}
expect "Enter metadata_storage database name*" {send "\r"}
expect "Enter metadata_storage database username*" {send "\r"}
expect "Enter password:" {send "123\r"}
expect "Confirm password:" {send "123\r"}
expect "Installation can take some minutes*" {send "\r"}
interact;
END
Each time when expect see question:
Enter metadata_manager database name (leave blank for default 'metadata_manager'):
Expect interrupt install-script... i tryed to write:
- \'
- \\'
- *
But it doesnt matter to my situation... i alredy have broke my mind with it and srtongly ask for help...
|