I am using the Community Edition of ActiveTcl from ActiveState on Windows with the Expect package installed. I have tried writing my own scripts, downloading some from various websites, and even copying and pasting them from the ActiveState website itself, but I always run into the same problem. My scripts can send commands perfectly and configure network devices as expected, but only by sandwiching sends with sleep periods. Whenever I try matching anything with expect, I always get the same thing (when using exp_internal 1): expect: does "" (spawn_id exp4) match glob pattern "AnyString"? no. And the same thing for regular expressions: expect: does "" (spawn_id exp4) match regular expression "AnyString"? no. The only time it seems to work is with a single wildcard: expect: does "" (spawn_id exp4) match glob pattern "*"? yes expect: set expect_out(0,string) "" expect: set expect_out(spawn_id) "exp4" expect: set expect_out(buffer) "" But no other combination of wildcards, literal or regex, seem to work. I have watched videos and seen screenshots. From what I can tell expect should iterate each character until a match is found, but it literally just stops at "", times out, and continues on to the next line. I am sure I am doing something obviously fundamentally wrong if the expect command does not work in Expect, but I just don't know what. It's as if it cannot read any of terminal output, but the send commands work perfectly so I know it's connected. Whatever terminal program I am trying (telnet, plink, netcat, etc.) all have the same problem. Expect really seems to be an awesome automation tool, so I'd really appreciate any suggestions that might help me get over this. I am fully expecting to feel stupid after receiving the answer.
Expect scripts cannot match
261 Views Asked by Aerasol At
1
There are 1 best solutions below
Related Questions in SCRIPTING
- How do I react to external program launch inside an Automator workflow?
- can anyone help me for NSIS Script I have a case where I need to check cases can be 3.3 3.42 23.5 23.56w 3.467 999.999 999.99a but not 1.b or 8..a
- How do I restart a batch file in PowerShell?
- Trouble updating a Field in Salesforce via a Python Script
- What are JCL Alternitives for Embeded Applications?
- grep expression behaving weird (unix/mac) while reading a conf file
- Why is my bash script showing [2: command not found?
- How can I modify my code to negate this error?
- Find Specified Software - Powershell
- how to change Value to something specific and not add to it?
- How can I run this Powershell function from a batch file on windows?
- How to make toggle key to switch between two seperate functions lua script(logitech)
- My quiz automatically submits when i plug in a chrome extension that involves doing an api call
- How to "make" a variable that contains another variable value?
- function not recognizable inside scriptblock in PowerShell script
Related Questions in TCL
- Is there a proper way to "break" out of a switch script and remain in the procedure other than wrapping in a loop?
- Tcl/TK: how to prevent screen tearing?
- Need help on _tkinter.TclError: invalid command name "<!DOCTYPE"
- Is it possible to use function pointers with critcl?
- In Tcl, why do I have to use quotes and curly braces for expr's argument when comparing two string literals?
- What are JCL Alternitives for Embeded Applications?
- sort array of floating point numbers in tcl
- TclOO metaclass classes objects and objdefine
- In Tcl, why is the string length of an empty string 1, not 0?
- exit(EXIT_FAILURE) : the Tcl C API equivalent
- How to decompress the contents of a var to another var?
- namespace ensemble create : limited scope
- why DSR is not working in FANET in NS2 using z=10.0
- anaconda search path ruins tcl package search path
- Tcl package textutil disappeared
Related Questions in EXPECT
- Expect: Any way to match a specific rule only once?
- How can I compress repetitive expect matches with a loop?
- Rsync within expect script: error "No such file or directory"
- Expect sudo - comand
- python playwright expect pytest class
- How can I pass commands to SSH when using expect while it doesn't support using double quotes?
- Wildcard(*) SFTP in an expect script?
- Expect script to iterate through list of files, fetch file and perform local file manipulation
- Can two subprocesses both send messages to stdout inside a Tcl/Expect script?
- Expect script <<sudo - instructions >> doesn't work
- Expect script: How to interrupt (ctrl+c) running script after defined time
- Expect script: How to set return value of a command to a variable and exit from script if the return value is not 0?
- Is it possible to force `expect` to `puts` a string of nulls without a newline?
- Playright loop while condition is met in addition to that keep clicking on refresh button every 10 seconds until locator found
- What is the difference between referencing a HEREDOC and a File when using expect
Related Questions in ACTIVESTATE
- Non-Greedy Capture between parens in TCL: #\( .*?\)
- Did ActiveState stop providing plain old MSI installer of Perl for Windows?
- Can't get Win32::NetResource
- installing ActiveState Python 3.9 under windows 10/11
- Preparing Installer for State Tool Package Manager. . .x Failed
- Exception calling "DownloadString" with "1' argument<s>
- install_driver(mysql) failed: Attempt to reload DBD/mysql.pm aborted error in Bugzilla installation on Windows
- ActiveState log files proliferate in VS code
- File .log with "Could not load configuration: Failed to load configuration" VSCode
- How should I deal with Activestate removing PPM from their Perl?
- python cannot see ActiveTcl after installation
- How does ActiveState's PPM generate HTML and where does it store it?
- Python Error: ModuleNotFoundError: No module named 'cryptography.hazmat.bindings._constant_time'
- Unable to Install SOAP LITE
- How can I distribute an application with many perlapp executables but distribute only one perl
Related Questions in ACTIVETCL
- puts to stdout not happening if expect loaded in 2 threads
- Spin: gcc-6: unrecognized command line option
- Unable to spawn ssh using expect in ActiveTcl on Windows PC
- compiling tcltls .so with static openssl-Lib
- Additional "2000" String ([32 30 30 30] bytes) at the beginning of a file
- Tkinter keeps crashing on Tk() on Mac
- Reading an xml file on localmachine(on which ActiveTCL and expect package is installed) and writing it to a spawned machine
- Warning for Tcl/Tk version 8.5.9 in python IDLE
- Expect scripts cannot match
- Getting error using Tkinter in python on mac OS X
- Tkinter Scrollbar bug on mac with ActiveTcl 8.5.18
- Python 3.5 Tkinter "unstable" warning in IDLE
- Errno2: No such file or directory when using tkinter
- Python IDLE Autocomplete and Call Tips No Longer Pop Up
- Python3 and Tcl/Tk 8.5 on OS X 10.5
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
This is probably due to known issues with Expect on later versions of Windows, which are unfortunately poorly documented. Expect may work on Win7 or Win8, probably not on Win10. It will generally work better on 32-bit Windows than 64-bit Windows.