Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help with Expect matching

Status
Not open for further replies.

richwd

Programmer
Oct 12, 2011
17
0
0
US
I'm sending some bash commands to run on the Linux command line of the target machine, but I can't figure out why this code fails? Any ideas?



expect: does " if [[ -d "emptyfolder1319665962" ]]\n> " (spawn_id exp4) match glob pattern " if [[ -d "emptyfolder1319665962" ]]\n> "? no

expect: timed out
 
Tried again without the quotes but still fails.

expect: does " if [[ -d emptyfolder1319666737 ]]\n> " (spawn_id exp4) match glob pattern " if [[ -d emptyfolder1319666737 ]]\n> "? no

expect: timed out
 
Also tried with one square bracket:

expect: does " if [ -d emptyfolder1319668531 ]\n> " (spawn_id exp4) match glob pattern " if [ -d emptyfolder1319668531 ]\n> "? no

expect: timed out
 
Code:
expect: does "if [[ $FILE =~ ^[A-F0-9]{32}[.][A-F0-9]{8}[.]jpg$ ]]; then\n> " (spawn_id exp6) match glob pattern "if [[ $FILE =~ ^[A-F0-9]{32}[.][A-F0-9]{8}[.]jpg$ ]]; then\n> "? no

expect: timed out

Why can't I match any if commands? What's so different about them? Every line I have with if on it doesn't match.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top