Nov 3, 2008, 2:33 AM
Post #1 of 1
Telnet, print FILE and multiple pages
I have encountered a following problem: I am using Telnet to connect some remote device (switch). I want to send a command to it, receive it's configuration and save it to a file. The configuration is long, so when browsing it normally I need to press 'space' when '--more--' appears. So, in the script I do ...->waitfor and catch --more--, then I send ' ' and all is OK.
Then the strange behavior occurs. When I print ($prematch, $match) from ->waitfor function to the screen with 'print' , all is OK. But when I print it to file with 'print FILE', it also saves '--more--' strings that were not printed previously :(
Any clue what is happening?