.*s 1 "Starting the Program"

.*s 2 "Simple Startup - Initial Setup Menu"

ECU may be started in a number of ways through use of
command line switches, but the easiest is to enter
.DS I
ecu
.DE
by itself.
In this case, the screen is cleared
and the following screen, called the
.B setup
.B screen ,
will be presented.
.DS L
        .--[ ecu 3.20-386u wht@n4hgf ]---------------------------------.
        |                                                              |
        |  Destination   ________________________________________      |
        |                                                              |
        |                                                              |
        |                                                              |
        |  tty: /dev/tty2b                                             |
        |                                                              |
        |  duplex: F  baud: 9600   parity:N  (data bits 8)             |
        |  add NL to transmitted CR: N                                 |
        |  add NL to received CR:    N                                 |
        |                                                              |
        |                                                              |
        |   TAB:next ^B:prev END:proceed ^D:phone dir  ESC:quit ecu    |
        `- logical phone directory entry, phone number or empty -------'

.DE
Several choices may be made by navigating the setup screen.
When you position to a field, helpful text is displayed
on the bottom line of the form.

It is important to note that you may not exit this screen
into ECU operation without opening a communications line.

The initial (default) values for some of the fields may be modified
by command line switches or by the special procedure "_rc.ep".
Also, entering a dialing directory entry name in the 'Destination'
field and pressing Return will override the defaults with the values
in the directory entry.
See the sections related to dialing
and the section in the Procedure Language manual titled "_rc.ep".

.*s 3 "Destination"

If a dialing directory has been configured,
a literal phone number need not be entered.
However, on your first invocation,  you'll very likely have
no directory.  Therefore, you have three options:

.DS I
1.  Enter a literal telephone number, (e.g. 18005551212).
    Hyphens and open and close parentheses may also
    be entered.

2.  Press ENTER to skip the 'Destination' field and enter
    ^D to enter the telephone directory to enter your
    first directory entry.

3.  Press END to enter interactive mode to communicate
    directly with the attached DCE (modem).
.DE

.*s 3 "Other Fields"

The 'tty' field may be used to select an outgoing line
other than the default.
For important considerations on line choice, see the sections
titled "Choosing a Dialout Line" and "DCDwatch".

The 'duplex' field may be used to select a
duplex value other than the default 'F' (full).

The 'baud' field may be used to select a
baud rate value other than the default selected at Configure time.

The 'parity' field may be used to select a
parity value other than the default selected at Configure time.


The 'Add NL to transmitted CR' and 'Add NL to received CR'
fields are usually left defaulted to 'N' (no).  If you
will be communicating with a terminal (as in a chat with a human), you
will usually need to set both of these fields to 'Y' as
well as to select 'H'alf duplex.

.*s 3 "Keyboard Functions"

Special keyboard characters while filling in the
startup screen are:


.DS I
 Enter        terminate entry in a field (or skip to
              the next field if you do not modify it)

 ^B           back up to previous field

 Cursor Up    same as ^B (if the key is available on
              your terminal and environment).

 TAB          move to next field ... if nothing typed in
              the field, do not disturb contents

 Cursor Down  same as TAB (if the key is available on
              your terminal and environment).

 END          proceed with session, dialing remote if
              logical directory entry name or literal
              telephone number enetered

 ^D           enter phone directory

 ESC          quit ecu without starting a session
.DE

When editing a multicharacter field, such as "tty", you may use the
backspace key in the traditional fashion.  Depending on the
terminal, ECU version in use (OS in use), and configuration,
you may also be able to use the cursor left and right keys
and the insert key (to toggle insert mode).

.*s 2 "Command Line Switches and Arguments"

ECU can be started in a number of ways:
.DS I
o  with no switches or arguments
       select options interactively; manual command to begin
       connection

o  with switches (excluding -p) and no arguments
       override some defaults for options but still enter
       interactive option selection; manual command to begin
       connection

o  zero or more switches (excluding -p) and one argument
       fully automatic startup to connect to the remote
       specified by the argument (a telephone number
       or dialing directory entry)

o  zero or more switches, with -p the last switch
       fully automatic startup by executing procedure whose
       name is specified by the first argument; the initial
       procedure receives the remainder of the command line
       arguments
.DE

.*s 3 "Usage Summary"

.DS I
usage: ecu [-l <ttyname>] [-b <baud_rate>] [-eon]
           [-h] [-t] [-P <phonedir>]
           [-F name] [-T <trace-level>]
           [-p <initial_proc> [-d] [-D] | <phone_number>]
-D unconditionally stop execution when -p initial
   procedure is done
-F sets an alternate funckeymap name for the *keyboard*
-P choose alternate phone directory (<phonedir> must be
   a full pathname)
-T set procedure tracing to level: 0=none, 1=standard,
   2=ECU-debugging
-b choose baud rate (any UNIX rate 110-38400)
-d stop execution if -p initial procedure fails
-e even parity   -o odd parity   -n no parity
-h half duplex ... default is full duplex
-l choose line (/dev/<ttyname>)
-p execute an initial procedure
-t append NL to incoming and outgoing CR characters
<phone_number> is either an actual number or a dialing
   directory entry name
.DE

.*s 3 "Switches"

Many switches are used to override defaults specified
at the time the Confifgure procedure was used.
Note these defaults may also be overriden interactively if the command
does not specify automatic startup option (-p or dialing argument).
Also, the value chosen by a dialing directory entry or an
initial procedure will override
the Configured default and/or the value specified by this switch.

.*s 4 "-b <baud>"

This switch overrides the default baud rate.
Any valid UNIX rate may be chosen.  
ECU chooses the number of stop bits based on the baud rate.  Rates below
300 baud get 2 stop bits.  Rates 300 baud and above get one stop bit.

.*s 4 "-d"

The
.B
-d switch
.R
instructs ECU to "die" (terminate with error status) if
an initial procedure (-p) fails.  This switch ensures a batch
ECU execution will hang up any connection and terminate if
a procedure error occurs. See also -D below.

Absence of the
.B -d
and
.B -D
switches
causes ecu (upon any completion of the
initial procedure) to enter the 1) interactive mode if a line
was successfully attached by the procedure or 2) the setup screen
if no line was attached. 

.*s 4 "-e, -o, -n"

Normally, ECU starts up with data bits and parity chosen at
Configure time.  The 
.B -e ,
.B -o 
and
.B -n 
.B switches
allow you to override the default.

Since combinations like eight data bit and even parity or
seven data bits and no parity are not in  ECU's
capability to use, the parity selection also dictates the
choice of data bits. Even or odd parity implies seven data bits.
No parity implies eight data bits.

.*s 4 "-h"

Normally, ECU starts up in the full duplex mode.
If half duplex is desired, the
.B
-h switch
.R
is used.

.*s 4 "-l ttyspec"

When ECU starts up, it normally chooses a line as described later
in the section titled "Choosing a Dialout Line".
Specifying the
.B -l
.B switch
overrides the default tty specified
at Configure time.  Depending upon other command line options,
this switch may be nothing more than a hint.

The argument to the switch is the base name
of the tty (e.g., "tty1a" or "acu0").  On SCO, since ttys are all
named consistently according to the "/dev/ttyxx" form, you may
omit the "tty" (e.g., "1a" or "4g").

For important considerations on line choice, see the sections
titled "Choosing a Dialout Line" and "DCDwatch".

.*s 4 "-p <proc>"

The 
.B
-p switch
.R
causes ECU to execute the procedure <proc> ("<proc>.ep")
immediately upon startup.  Such a procedure is termed the
.B
initial procedure.
.R
It is recommended that, when used, -p be the last switch on the
command line.  All non-switch arguments after <proc> are passed
as arguments to the initial procedure (see the descriptions of
the integer function
.B %argc
and the string function
.B %argv 
in the Procedure Manual).

For example,
.DS L
    ecu -p batchjob remsys 22
automatically executes the procedure command equivalent
    do 'batchjob' 'remsys' '22'
.DE

The initial procedure may read command line options
with functions like
.B %line ,
.B %baud
and
.B %parity .
It is also free to override any of these values it wishes.
See the procedure manual for more information.

.*s 4 "-t"

The
.B
-t switch
.R
instructs ECU to map incoming and outgoing carriage
returns to carriage return/line feed pairs.
This is helpful if the remote connection will be to a
display terminal rather than a computer.  Use of the
.B
-h switch
.R
may also be necessary.

The interactive commands
.B nlin
and
.B nlout
also control this feature.

.*s 4 "-D"

The
.B
-D switch
.R
instructs ECU to unconditionally terminate when an
initial procedure finishes.  Contrast with the
.B -d
.B switch .

.*s 4 "-F name"

Normally, the TERM environment variable is used to determine the
funckeymap entry (keyboard configuration) to be used.  Sometimes,
the TERM variable is not adequate for identifying your keyboard
arrangement.  The 
.B
-F switch
.R
switch, like the $ECUFUNCKEY environment variable, allows you to
use override the funckeymap entry used.  For more information,
see the section titled "Function Key Mapping (Recognition)".

.*s 4 "-P phonedir"

The
.B
-P switch
.R
causes ECU to begin execution using an alternate 
phone directory.  The default is ~/.ecu/phone.  You should
specify a full pathname if you anticipate using the change directory
command once ecu starts.

.*s 4 "-T level"

The
.B
-T switch
.R
sets the procedure language trace level.  <level> is a decimal
digit.  0 is for no tracing (the default) and 1 is for tracing.
Values higher than 1 are for debugging ECU and have varying effects
from revision to revision.

.*s 3 "Non-Switch Arguments"

Aguments are optional.
<tel-number> or <logical> may appear when the -p switch is absent.
One or more <arg> arguments may appear when the -p switch is used.
These arguments are handled as described by "-p" above.

.*s 4 "<tel-number>"

This type of argument has a digit as its initial character and
represents an actual telephone number to be passed to a modem
dialer program or Dialers chat script.  The string may contain
non-numeric characters if appropriate for a dialer program,
such as dialTBIT or dialgT2500 (see the gendial subdirectory).
For example:
.DS L
    ecu -ltty2a -b 19200 -e 5551212C
.DE
uses tty2a (assumed to be connected to a Trailblazer modem because
of the dialer-specific telephone number) and
establishes a 19200 baud, even parity PEP Compressed connection
after dialing 5551212.

.*s 4 "<logical>"

This type of argument has an alphabetic initial character and
causes the dialing directory entry by that name to be dialed.
The line may be specified by '-l', but if the dialing directory
specifies a line (tty field contains other than 'Any'), the
dialing directory entry will override it.  The '-b', '-e' and '-o'
switches are ignored; the values specified by the dialing directory
entry are used.  The '-t' and '-h' switches are valid and honored
if present.

.*s 4 "<arg>"

This type of argument is passed to an initial procedure when
the -p switch is present.

.DS L
ecu -p unixlogin user pwd ansi43
.DE
executes unixlogin.ep with arguments 'user' 'pwd' 'ansi43'

For more detail, refer to the description of -p, -d and -D below.

.*s 2 "Environment Variables"

Prior to starting ECU, it is useful, but not necessary,
to establish two environment variables, ECUPROMPT and ECUHELP.

.*s 3 "ECUPROMPT"

The ECUPROMPT environment variable determines the prompt printed
by ECU when the interactive command key ("HOME") is pressed.
When you first run ECU, try setting it to your name, e. g.,
.DS I
setenv ECUPROMPT Ralph    if you use csh

ECUPROMPT=Ralph           if you use sh, ksh, etc.
export ECUPROMPT
.DE
Then, when you see how it used, you may wish to
establish a more permanent choice in your .login or .profile.

.*s 3 "ECUHELP"

Ordinarily, ECU looks for interactive command help information
in "ecuhelp.data"
(in the ecu library directory, normally /usr/local/lib/ecu).
The ECUHELP environment may be set to the complete
pathname of the ecu help file if an alternate file
is to be used.

The help file is explained later in the section
titled "Online Command Dictionary".

.*s 3 "ECUFUNCKEY"

See the description of the 
.B -F
command line switch and the section titled
"Function Key Mapping (Recognition)".

