Sending Double quotas to expect script in bash
I'm trying to figure this out for a while now, with no luck. I have the following bash script block:
When running this script, I get the following error:
I tried every possible escape char with no luck so far...
Please use ***[code][/code]*** tags around your code and data, to preserve the original formatting and to improve readability. Do not use quote tags, bolding, colors, "start/end" lines, or other creative techniques.
I'm not at all familiar with expect, but one of the most common mistakes in the shell is attempting to store quotes or other shell syntax in variables.
I'm trying to put a command in a variable, but the complex cases always fail!
It may or may not be related to your problem, but if it's possible, try removing the quotes from the variable and instead include them in the expect script itself (assuming I'm reading the code correctly).
In addition, I believe the key line in your error message is this:
Finally, I also highly suggest moving all that code into a function, and running that, instead of trying to shove it all into the $(..) bracket.
First of all, Thank for replaying, David.
I did some additional testing and it seems there is some kind of a conflict when embedding expect script into bash.
When creating a "pure" expect script (starting with #!/bin/expect) - quotas are been sent without any problem.
when sending the same syntax as a command to expect under bash runtime - something goes wrong. It seems like although Expect should run the command - bash still reads the quotas and then throws the above error. I think I'm going to run in outside bash using an additional expect script. :-/
|All times are GMT -5. The time now is 06:00 AM.|