ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> expect
expect
Re: [Expect] End-of-line conventions on Expect for Windows
by David Gravereaux other posts by this author
Sep 9 2007 10:06PM messages near this date
view in the new Beta List Site
[Expect] End-of-line conventions on Expect for Windows | Re: [Expect] End-of-line conventions on Expect for Windows
Kenneth Jones wrote:

...
>  First challenge was successfully [spawn]ing telnet and driving it with
>  my script. Research brought me to David Gravereaux's recurring
>  instructions regarding DEP and dbghlp.dll. It seems to be such a
>  frequently asked question, and such a stumbling block for successfully
>  running many Expect for Windows scripts, I strongly suggest some note
>  in the documentation. I'd never even heard of DEP prior to this.

Full agreement there.  The DEP issue relates to Microsoft's telnet.exe, as the
OS considers it part of the operating system and won't let one modify memory
while intercepting it.  pretty odd, IMO.

>  I'm quite familiar with the various end-of-line conventions in Expect
>  on UNIX, brought about by the interactions with the pttys. But
>  especially considering that I know that Windows typically uses \r\n as
>  EOL, I was surprised that all of my scripts were receiving only \n as
>  EOL.

It's my understanding that \r\n is just a convention for text files held over
from the days of DOS.  Expect is grabbing text sent on the way to a console,
which isn't a 'text file' as stored on disk.

Alex, the author of MacCVS, thought \r was supposed to be used as EOL for
putting text to the log console..  Think a text widget as in Tk.  I kept
getting bugs for it, but I was just responsible for the Tcl stuff.

But then again, according to ANSI usage, to move the cursor to the beginning
of the next line is CNL '\e[E'.  Which isn't a character, it's an action and
this distinction with E4W is quite unclear.

\n seems like the most logical translation for that action.

=================

Trivia:  How do you send an F4 keypress to a windows console app with E4W?

.
.
.
.
.
.
.
.
.
.
.

You can't currently, but someone could modify it one day as most of the code
is there.  Someone needs to pick a viable way to translate that action from
the text in the exp_send call.  For an ANSI term, I think, is <SS3 P>  or
'\eOP' for F1.
_______________________________________________
Expect mailing list
Expect@[...].com
http://listserv.ActiveState.com/mailman/listinfo/expect
Thread:
Kenneth Jones
David Gravereaux
Kenneth Jones

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved