Most of the Linux environments I work with are RHEL or CentOS and our prompts look like:
[username@hostname ~]$
I can't seem to find a prompt pattern that works for both the closing square bracket and the dollar sign when writing a script using the com.santaba.agent.groovyapi.expect.Expect package. No amount of escaping seems to work like '\\]\\$' or ']\\$'. I do need the multi-character prompt because the output I want to parse will include errant $, but not ]$.
Multi-character prompts are generally not a problem because I often have to expect a sudo password prompt using a 'username:' pattern and this works without issue.
Most of the Linux environments I work with are RHEL or CentOS and our prompts look like:
I can't seem to find a prompt pattern that works for both the closing square bracket and the dollar sign when writing a script using the com.santaba.agent.groovyapi.expect.Expect package. No amount of escaping seems to work like '\\]\\$' or ']\\$'. I do need the multi-character prompt because the output I want to parse will include errant $, but not ]$.
Multi-character prompts are generally not a problem because I often have to expect a sudo password prompt using a 'username:' pattern and this works without issue.
Any ideas on how to tackle this?
Share this post
Link to post
Share on other sites