If you're trying to automate a console session, you may consider using the Expect perl module. I haven't used every function, but the expect and send functions seem to work well and that's usually all you need. Keeps me from having to use tcl ;-)
> -----Original Message----- > From: John [mailto:[EMAIL PROTECTED]] > Sent: Sunday, March 17, 2002 10:13 PM > To: [EMAIL PROTECTED] > Subject: RE: xmit Perl code for carriage return during telnet session > > > Daniel, > > Thanks for the suggestion, but I'd already tried that > variation-on-a-theme > with no luck. > > I'm really looking for the right code to have telnet execute > an Enter key > function at the finish of my perl script. > > John-- > > -----Original Message----- > From: Daniel Gardner [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 18, 2002 12:45 AM > To: John > Cc: [EMAIL PROTECTED] > Subject: Re: xmit Perl code for carriage return during telnet session > > > Hello John, > > Monday, March 18, 2002, 5:15:18 AM, John wrote: > > > > I do not understand the results of the following > experiment, and would > > appreciate input. > > > Using telnet on a Win PC, I executed this code: > > > perl -e ‘print "Hello world.\n\r"' > /dev/tty1 > > > On my Linux system monitor (/dev/tty1), I see "Hello > world." printed along > > with the newline and carriage return. > > > What I don't understand is why I don't see a return of my > Linux screen > > prompt until I hit the Enter key on that system. > > > Should I be flushing some sort of buffer, closing a file, > or transmitting > > some other code sequence to indicate an end to my output? > > try without the \r > > \n is a "newline", \r a "carriage return", in windows files > you usually need both, on unix you usually only need the > newline. > > the \r in this case will move the cursor back to the start > of the line, overwriting the prompt which is there. > > > -- > Best Regards, > Daniel [EMAIL PROTECTED] > > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]