Changeset 40277 in project for wiki/eggref/5/tcl-expect


Ignore:
Timestamp:
07/14/21 09:00:25 (3 months ago)
Author:
svnwiki
Message:

Anonymous wiki edit for IP [78.85.5.18]: revert to 0.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wiki/eggref/5/tcl-expect

    r40180 r40277  
    1616
    1717* Linux
     18* sh
    1819* libtcl
    1920* libexpect
     
    6162<procedure>(call-with-process-io cmd proc)</procedure>
    6263
    63 Forks a new process and executes {{cmd}} then call {{proc}} which should be a procedure of three arguments: the input, output, and PID of the sub-process.
     64Forks a new process and executes {{cmd}} via Bourne shell then call {{proc}} which should be a procedure of three arguments: the input, output, and PID of the sub-process.
    6465
    6566'''Note''': The input and output ports will not be closed if {{proc}} raises an error
     
    6768While it is possible to use {{read-line}} to read information from a process spawned by {{call-with-process-io}}, more convenient function are provided.
    6869
    69 <procedure>(expect in-port pattern [timeout 10])</procedure>
     70<procedure>(expect in-port pattern)</procedure>
    7071
    7172The function waits until the output from a process matches the pattern, a specified time period has passed, or an EOF is seen.
    72 The first argument to the function is an in-port the second argument is a Tcl glob-style string pattern the optional third argument sets timeout. The default timeout period is 10 seconds. A value of -1 disables a timeout from occurring. A value of 0 causes the function to return immediately.
     73The first argument to the function is an in-port the second argument is a Tcl glob-style string pattern.
    7374
    7475Returns one of the following values
     
    7778* timeout
    7879* fullbuffer
     80
     81<procedure>(set-timeout secs)</procedure>
     82
     83Sets timeout for {{expect}} function. The default timeout period is 10 seconds. A value of -1 disables a timeout from occurring. A value of 0 causes the {{expect}} function to return immediately.
    7984
    8085=== Example
     
    96101
    97102* 0.1 Initial release
    98 * 0.2
    99 ** set-timeout function has been removed
    100 ** spawn function no longer uses 'sh' to execute commands
    101 ** expect function now takes an optional third argument - timeout
    102103
    103104=== License
Note: See TracChangeset for help on using the changeset viewer.