From: Bruno N. <bn...@gm...> - 2007-07-31 23:02:26
|
Hello all, Can you tell me why isn't the expect(1, '-re', $string) bellow matching successfully? I put in color RED the debug message showing that the pattern in $string is exactly what expect has on it's accumulator. So why isn't it matching? There are some "\n" in the pattern, can it be a problem? Starting EXPECT pattern matching... Expect::expect('Expect=GLOB(0x8064a020)',0,'-re',' PID TTY TIME CMD\x{a} 9724 ? 00:00:00 bash\x{a} 988...') called at /home/brunonz/Net-SSH-Expect/lib/Net/SSH/Expect.pm line 239 Net::SSH::Expect::eat('Net::SSH::Expect=ARRAY(0x80173ce0)',' PID TTY TIME CMD\x{a} 9724 ? 00:00:00 bash\x{a} 988...') called at /home/brunonz/Net-SSH-Expect/lib/Net/SSH/Expect.pm line 270 Net::SSH::Expect::readAll('Net::SSH::Expect=ARRAY(0x80173ce0)',1) called at /home/brunonz/Net-SSH-Expect/lib/Net/SSH/Expect.pm line 289 Net::SSH::Expect::exec('Net::SSH::Expect=ARRAY(0x80173ce0)','ps',1) called at ./wshell line 66 eval {...} called at ./wshell line 65 spawn id(3): list of patterns: #1: -re ` PID TTY TIME CMD\n 9724 ? 00:00:00 bash\n 9888 ? 00:00:00 bash\n12978 ? 00:00:00 bash\n13075 ? 00:00:00 ps\n' spawn id(3): Does ` PID TTY TIME CMD\n 9724 ? 00:00:00 bash\n 9888 ? 00:00:00 bash\n12978 ? 00:00:00 bash\n13075 ? 00:00:00 ps\n' match: pattern #1: -re ` PID TTY TIME CMD\n 9724 ? 00:00:00 bash\n 9888 ? 00:00:00 bash\n12978 ? 00:00:00 bash\n13075 ? 00:00:00 ps\n'? No. Best regards, bruno |