• Looking for better documentation for "Expect"

    From Kenny McCormack@21:1/5 to All on Sun Jul 23 02:30:20 2023
    By "better", I mean reference, not tutorial.

    The only documentation that I am aware of is the book "Exploring Expect"
    (by Don Libes), which I have and which is an excellent book. But this book
    is explicitly tutorial and not reference. If something isn't needed for
    one of his examples, you'll never find out about it.

    Admitedly, the book (EE) is over 20 years old, so it may not have the latest features. Note also: The other source of information on Expect is the man
    page ("man expect"), which I have also read.

    That said, here are two areas (these are not really the focus of my
    question, but I provide them as illustrative of the problem):

    1) The "expect" command has many more options than are documented
    either in the EE book or the man page. One example is the
    "-timeout" option. I found this out by doing: expect --help

    2) The spawn_out array probably has many elements, but the only one I
    have ever used (and the only one mentioned in EE) is
    spawn_out(slave,name). The man page also mentions slave,fd.
    I would like to know how to figure out what else is there.

    But what I am really after is: Is there an actual reference manual that lists everything? I've found pretty complete, reference, documentation for TCL,
    but not for Expect.

    --
    "He is exactly as they taught in KGB school: an egoist, a liar, but talented - he
    knows the mind of the wrestling-loving, under-educated, authoritarian-admiring white male populous."
    - Malcolm Nance, p59. -

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From heinrichmartin@21:1/5 to Kenny McCormack on Sun Jul 23 04:55:21 2023
    On Sunday, July 23, 2023 at 4:30:25 AM UTC+2, Kenny McCormack wrote:
    By "better", I mean reference, not tutorial.

    The only documentation that I am aware of is the book "Exploring Expect"
    (by Don Libes), which I have and which is an excellent book. But this book is explicitly tutorial and not reference. If something isn't needed for
    one of his examples, you'll never find out about it.

    Admitedly, the book (EE) is over 20 years old, so it may not have the latest features. Note also: The other source of information on Expect is the man page ("man expect"), which I have also read.

    That said, here are two areas (these are not really the focus of my question, but I provide them as illustrative of the problem):

    1) The "expect" command has many more options than are documented
    either in the EE book or the man page. One example is the
    "-timeout" option. I found this out by doing: expect --help

    2) The spawn_out array probably has many elements, but the only one I
    have ever used (and the only one mentioned in EE) is
    spawn_out(slave,name). The man page also mentions slave,fd.
    I would like to know how to figure out what else is there.

    But what I am really after is: Is there an actual reference manual that lists
    everything? I've found pretty complete, reference, documentation for TCL, but not for Expect.

    Probably not the answer you were looking for, but my best source was the manpage (then the code).
    And I have detected new aspects in the manpage after I _thinking_ that I have read it all.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to [email protected] on Sun Jul 23 12:33:00 2023
    In article <[email protected]>, heinrichmartin <[email protected]> wrote:
    ...
    But what I am really after is: Is there an actual reference manual that lists
    everything? I've found pretty complete, reference, documentation for TCL,
    but not for Expect.

    Probably not the answer you were looking for, but my best source was the >manpage (then the code). And I have detected new aspects in the manpage >after I _thinking_ that I have read it all.

    Yeah, that's kind of what I expected. But, as I said, I can tell that
    there are options to (e.g.) "expect" that are not documented either in EE
    or in the man page. Observe:

    expect 1.1> expect --help
    Error: bad flag "--help": must be -glob, -regexp, -exact, -notransfer,
    -nocase, -i, -indices, -iread, -timestamp, -timeout, -nobrace, or --
    expect 1.2>

    I know (or can guess) what some of those do, but most of them are not in EE
    and at least a few of them are not in "man expect".

    On a more cheery note, I did figure out from the above that there was a -timeout flag - which I think is a good thing. I've always thought that it would be a good thing to be able to specify the timeout "on-the-fly"
    without having to modify the global variable ("timeout").

    Anyway, as you say, reading the source code is always the last resort...

    P.S. Incidentally, I don't think I ever actually have read the Expect manpage cover-to-cover. I didn't really realize that it was that sort of manpage (*) until I started researching for making this post (thread). I guess I need
    to do that (read it cover-to-cover).

    (*) By "that sort of manpage", I mean when you're talking about a
    programming language and the manpage is actually the documentation for that programming language. "dmake" is an example of such - the manpage is the language documentation (and it is a very long manpage). It would be funny
    if "man gcc" actually told you everything you need to learn the C language
    and become a C programmer (heh heh).

    --

    Prayer has no place in the public schools, just like facts
    have no place in organized religion.
    -- Superintendent Chalmers

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Colin Macleod@21:1/5 to Kenny McCormack on Mon Jul 24 16:04:28 2023
    [email protected] (Kenny McCormack) wrote in news:u9j6ls$2k2th$[email protected]:

    Yeah, that's kind of what I expected. But, as I said, I can tell that
    there are options to (e.g.) "expect" that are not documented either in
    EE or in the man page. Observe:

    expect 1.1> expect --help
    Error: bad flag "--help": must be -glob, -regexp, -exact, -notransfer, -nocase, -i, -indices, -iread, -timestamp, -timeout, -nobrace, or --
    expect 1.2>

    I know (or can guess) what some of those do, but most of them are not
    in EE and at least a few of them are not in "man expect".

    On a more cheery note, I did figure out from the above that there was
    a -timeout flag - which I think is a good thing. I've always thought
    that it would be a good thing to be able to specify the timeout
    "on-the-fly" without having to modify the global variable ("timeout").

    The Expect man page I usually refer to is at https://www.tcl.tk/man/expect5.31/expect.1.html and this does document
    the -timeout flag for the expect command.

    Colin.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to [email protected] on Mon Jul 24 16:57:07 2023
    In article <[email protected]>,
    Colin Macleod <[email protected]d> wrote:
    ...

    The Expect man page I usually refer to is at ...
    ... and this does document
    the -timeout flag for the expect command.

    Yes. I noticed/realzed that -timeout is indeed mentioned iin the man page.

    But many of the others aren't.

    --
    The randomly chosen signature file that would have appeared here is more than 4 lines long. As such, it violates one or more Usenet RFCs. In order to remain in compliance with said RFCs, the actual sig can be found at the following URL:
    http://user.xmission.com/~gazelle/Sigs/FiftyPercent

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)