Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

expect if condition extra characters after close-quote while executing

i am trying execute this code to handle multiple selections may occurs in the automation execution ,however in this execution sometimes an internal error occurs and sending "^" will make it continue to the next step but my code fails .

this is the code

expect {
"Enter RETURN to continue or '^' to exit:"

{send "^\n",exp_continue }

"Select Systems Manager Menu Option:"
}
send "fm\n"

the error

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

extra characters after close-quote
    while executing
"send "^\n",exp_continue "
    invoked from within
"expect {
-ex "Enter RETURN to continue or '^' to exit:"

{send "^\n",exp_continue }

-ex "Select Systems Manager Menu Option:"
}"
    (file "./ClinicStop_extract.sh" line 29)
[root@localhost cron]#

i tried to handle this problem with this code but i didn’t get exactly where is the mistake in it since the double quotes inside the {}

>Solution :

You have two statements on that line, so you need a semicolon to separate them, not a comma, i.e.

{send "^\n"; exp_continue }
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading