I am trying to figure out how to use a string in a regular expression. I searched Google for an hour, thought I would just ask the experts.
It works:
#!/usr/bin/expect set MYSTR "value" if [ regexp -nocase "$MYSTR" $outcome matchresult ] then { ... }
This does not work:
#!/usr/bin/expect set MYSTR "value" if [ regexp -nocase {something here:\s+$MYSTR} $outcome matchresult ] then { ... }
I am sure this is a simple syntax problem.
thanks for the help
source share