Starting EXPECT pattern matching... at /usr/local/share/perl5/Expect.pm line 597 Expect::expect('Expect=GLOB(0x1b086f0)', undef, 'ARRAY(0x1ae5c80)') called at ./expecct_demo.pl line 40 handle id(5): list of patterns: #1: -re `[\r\n]?[^\r\n]+[%#>$] $' handle id(5): Does `' match: pattern #1: -re `[\r\n]?[^\r\n]+[%#>$] $'? No. handle id(5): Does `\033]0;elkuser1@da3p-gen-imn-aut001:~\007\033[?1034h[elkuser1@da3p-gen-imn-aut001 ~]$ ' match: pattern #1: -re `[\r\n]?[^\r\n]+[%#>$] $'? YES!! Before match string: `' Match string: `\033]0;elkuser1@da3p-gen-imn-aut001:~\007\033[?1034h[elkuser1@da3p-gen-imn-aut001 ~]$ ' After match string: `' Matchlist: () Calling hook CODE(0x1aa89d0)... Sending 'ls \r' to handle id(5) at /usr/local/share/perl5/Expect.pm line 1421 Expect::print('Expect=GLOB(0x1b086f0)', 'ls \x{d}') called at ./expecct_demo.pl line 38 main::__ANON__('Expect=GLOB(0x1b086f0)') called at /usr/local/share/perl5/Expect.pm line 825 Expect::_multi_expect(undef, undef, 'ARRAY(0x1616c90)') called at /usr/local/share/perl5/Expect.pm line 602 Expect::expect('Expect=GLOB(0x1b086f0)', undef, 'ARRAY(0x1ae5c80)') called at ./expecct_demo.pl line 40