NAME
rtsh - RTAP bourne/ksh shell
SYNOPSIS
rtsh [-ahikmnfprstuvx] [-c command] [-e RTAP environment name] [file
[argument ...]]
INTRODUCTION
rtsh is an interactive RTAP shell that is based on the public domain
ksh version 4.9. Special RTAP commands have been added to access the
database, scan system, and data historian. These commands can be used
either interactively or in an rtsh script. Upon invocation, a
database connection is established, an attempt is made to establish a
connection to the scan system, and a data historian connection to the
"historian config" point is established. If the database connection
fails, the shell will terminate. This document only summarizes the
System V, release 2 shell features. All of the System V features
except for ``restricted mode'' are implemented. See also the BUGS
section. Features of the Korn shell are described in more detail.
Only a subset of the Korn shell features are currently implemented.
See the set command for the meaning of the akmnfruvhx command line
flags.
The -s option is only valid on invocation of rtsh and indicates that
job control is not initialized, and /etc/profile, .profile, and $ENV
are not parsed. This option should be used when running shell
scripts. Note that if this option is specified for a shell script, no
functions, or aliases from the users .profile, and $ENV files can be
used.
The -e option specifies the RTAP environment to attach to.
The -c option specifies a command to execute. Once the command has
executed, the shell will terminate.
DESCRIPTION
Command syntax
The ``#'' character begins a one-line comment, unless the ``#'' occurs
inside a word. The tokens ``;'', ``|'', ``&'', ``;;'', ``||'',
``&&'', ``('', and ``)'' stand by themselves. A word is a sequence of
any other non-whitespace characters, which may also contain quoted
strings (quote character are ``''', ``"'', ```'', or a matching ``${
}'' or ``$( )'' pair). A name is an unquoted word made up of letters,
digits, or ``_''. Any number of whitespace characters (space and tab)
may separate words and tokens. In the following syntax, { ... }?
indicates an optional thing, { ... }* indicates zero or more
repetitions, { ... | ... } indicates alternatives.
statement:
( list )
{ list ; }
for name { in { word }* }? do list ; done
select name { in { word }* }? do list ; done
{ while | until } list ; do list ; done
if list ; then list ; { elif list ; then list ; }* { else list ;
}?fi
case name in { ( word { | word } ) list ;; }* esac
function name { list ; }
name () { list ; }
time pipe
The opening parenthesis of the pattern is optional. Redirection
may occur at the beginning or end of a statement.
command:
{ name=word }* { word }*
Redirection may occur anywhere in a command.
list:
cond
cond ; list
cond & list
cond:
pipe
pipe && cond
pipe || cond
pipe:
statement { | statement }*
The select statement
The select statement provides an automatic method of presenting the
user with a menu selection from several options. The words given in
the list are printed on standard error, each preceded by a number.
Typing the number on standard input sets the variable name to the word
that was selected. The data that was typed is preserved in a variable
called REPLY. The contents of the loop are then executed using the
selected value. A new prompt PS3 is used to indicate that a number
should be typed in to choose a value from the menu.
Menus will continue to be presented until an interrupt is received or
end-of-file is typed on input.
Alias expansion
Alias expansion occurs when the first word of a statement is a defined
alias, except when that alias is already being expanded. It also
occurs after the expansion of an alias whose definition ends with a
space.
Alternation
Csh provides a filename expansion method known as alternation. This
has been added into this version of ksh. When performing filename
substitution, you can get the shell to create a set of strings for
you. For example, `exampl{a,b,c,d,e}' will expand to ``exampla examplb
examplc exampld example''. A comma separated set of strings in curly
braces will be expanded into a set of strings that are passed into the
command. The strings are not sorted.
Shell Variables
The following standard special variables exist: !, #, $, -, ?.
# The number of positional parameters in decimal.
- (Dash) Options supplied to the shell on invocation or by the set
command.
? The decimal value returned by the last executed command.
$ The process number of this shell.
! The process number of the last background command invoked.
_ (Underscore) In interactive use this parameter is set to the last
word of the previous command. When a command is executed this
parameter is set to the full path of the command and placed in
the environment for the command. See also MAILPATH.
CDPATH
The search path for the cd command.
ENV If this variable is set at start-up (after any profile files are
executed), the expanded value is used as shell start-up file. It
typically contains function and alias definitions.
FCEDIT
The editor used by the fc command. During startup the shell
checks the value of FCEDIT, EDITOR and finally VISUAL to try and
determine what command line edit mode to use. Note that this is
not strictly ksh compatible behaviour.
COLUMNS
The width to use for the commandline editing (emacs mode only).
HISTFILE
The name of the file used to store history. If defined, history
will be loaded from this file on startup. Also, several
invocations of the shell running on the same machine will share
history if their HISTFILE variables all point at the same file.
HISTSIZE
The number of commands normally stored for history, default 128.
HOME The default directory for the cd command.
IFS Internal field separator, used during substitution and the read
command.
MAIL If set, the user will be informed of the arrival of mail in the
named file. This variable is ignored if the MAILPATH variable is
set.
MAILCHECK
How often, in seconds, the shell will check for mail in the
file(s) specified by MAIL or MAILPATH. If 0, the shell checks
before each prompt. The default is 600 seconds.
MAILPATH
A list of files to be checked for mail. The list is colon
separated, and each file may be followed by a ? and a message to
be printed if new mail has arrived. Command and parameter
substitution is performed on the message, and the parameter $_ is
set to the name of the file. The default message is ``you have
mail in $_''.
PATH The search path for executable commands and .'d files.
PPID The process number of the parent of the shell.
PS1 PS2
PS1 is the primary prompt for interactive shells. Dollar
substitution is performed, and ! is replaced with the command
number (see fc).
PWD OLDPWD
The current and previous working directories.
RANDOM
A random integer. The random number generator may be seeded by
assigning an integer value to this variable.
RTFS Field separator used for table field separation. The default if
not specified is the tab character. Use this if you want to use a
comma to separate table field values.
SECONDS
The number of seconds since the shell timer was started or reset.
Assigning an integer value to this variable resets the timer.
Substitution
In addition to the System Vr2 substitutions, the following are
available.
$(command)
Like `command`, but no escapes are recognized.
$(<file)
Equivalent to $(cat file), but without forking.
${#var}
The length of the string value of var, or the number of arguments
if var is * or @.
${var#pattern} ${var##pattern}
If pattern matches the beginning of the value of var, the matched
text is deleted from the result of substitution. A single #
results in the shortest match, two #'s results in the longest
match.
${var%pattern} ${var%%pattern}
Like # substitution, but deleting from the end of the value.
Expressions
Expressions can be used with the let command, as numeric arguments to
the test command, and as the value of an assignment to an integer
variable. Expression may contain alpha-numeric variable identifiers
and integer constants and may be combined with the following
operators:
== != <= < > >= + - * / % ! ( )
Command execution
After evaluation of keyword assignments and arguments, the type of
command is determined. A command may execute a shell function, a
shell built-in, or an executable file. Any keyword assignments are
then performed according to the type of command. In function calls
assignments are local to the function. Assignments in built-in
commands marked with a - persist, otherwise they are temporary.
Assignments in executable commands are exported to the sub-process
executing the command. Even on systems where the exec() family does
not support #! notation for scripts, ksh can be configured to fake
it. There are several built-in commands.
: Only expansion and assignment are performed. This is the default
if a command has no arguments.
. file
Execute the commands in file without forking. The file is
searched in the directories of $PATH. Passing arguments is not
implemented.
alias [name=value ...]
Without arguments, alias lists all aliases and their values. For
any name without a value, its value is listed. Any name with a
value defines an alias, see "Alias Expansion" above. Korn's
tracked aliases are not implemented, but System V command hashing
is (see "hash").
alias -d [name=value ...]
Directory aliases for tilde expansion, eg.
alias -d fac=/usr/local/usr/facilities
cd ~fac/bin
break [levels]
builtin command arg ...
Command is executed as a built-in command.
cd [path]
Set the working directory to path. If the parameter CDPATH is
set, it lists the search path for the directory containing path.
A null path means the current directory. If path is missing, the
home directory ($HOME) is used. If path is -, the previous
working directory is used. If path is .., the shell changes
directory to the parent directory, as determined from the value
of PWD. The PWD and OLDPWD variables are reset.
cd old new
The string new is substituted for old in the current directory,
and the shell attempts to change to the new directory.
configDb [args]
Allows database configuration. If no arguments are specified then
the command will enter an interactive mode where all of the
necessary information for the command will be prompted for.
Non-interactive mode requires entering information in the form of
<keyword>=<value>. <keyword> is dependent upon the configuration
action to be performed. As a minimum the "action" keyword must be
specified to indicate what configuration action to perform. See
"RTAP Extensions" section.
configDh [args]
Allows data historian configuration. If no arguments are
specified then the command will enter an interactive mode where
all of the necessary information for the command will be prompted
for.
Non-interactive mode requires entering information in the form of
<keyword>=<value>. <keyword> is dependent upon the configuration
action to be performed. As a minimum the "action" keyword must be
specified to indicate what configuration action to perform. See
"RTAP Extensions" section.
configPlot [args]
Allows plot configuration. If no arguments are specified then the
command will enter an interactive mode where all of the necessary
information for the command will be prompted for.
Non-interactive mode requires entering information in the form of
<keyword>=<value>. <keyword> is dependent upon the configuration
action to be performed. As a minimum the "action" keyword must be
specified to indicate what configuration action to perform. See
"RTAP Extensions" section.
connectDb <RTAP environment name>
Allows the shell to switch to a different database. Note that the
previous database/scan system connection is closed. Only one
database/scan system connection is maintained.
controlDb [args]
Allows database control actions. If no arguments are specified
then the command will enter an interactive mode where all of the
necessary information for the command will be prompted for.
Non-interactive mode requires entering information in the form of
<keyword>=<value>. <keyword> is dependent upon the control action
to be performed. As a minimum the "action" keyword must be
specified to indicate what control action to perform. See "RTAP
Extensions" section.
controlDh [args]
Allows data historian control actions. If no arguments are
specified then the command will enter an interactive mode where
all of the necessary information for the command will be prompted
for.
Non-interactive mode requires entering information in the form of
<keyword>=<value>. <keyword> is dependent upon the control action
to be performed. As a minimum the "action" keyword must be
specified to indicate what control action to perform. See "RTAP
Extensions" section.
controlPlot [args]
Allows plot display control actions. If no arguments are
specified then the command will enter an interactive mode where
all of the necessary information for the command will be prompted
for.
Non-interactive mode requires entering information in the form of
<keyword>=<value>. <keyword> is dependent upon the control action
to be performed. As a minimum the "action" keyword must be
specified to indicate what control action to perform. See "RTAP
Extensions" section.
controlSs [args]
Allows scan system control. If no arguments are specified then
the command will enter an interactive mode where all of the
necessary information for the command will be prompted for.
Non-interactive mode requires entering information in the form of
<keyword>=<value>. <keyword> is dependent upon the control action
to be performed. As a minimum the "action" keyword must be
specified to indicate what control action to perform. See "RTAP
Extensions" section.
continue [levels]
echo ...
eval command ...
exec command arg ...
The executable command is executed without forking. If no
arguments are given, any IO redirection is permanent.
exit [status]
fc [-e editor] [-lnr] [first [last]]
First and last select commands. Commands can be selected by
history number, or a string specifying the most recent command
starting with that string. The -l option lists the command on
stdout, and -n inhibits the default command numbers. The -r
option reverses the order of the list. Without -l, the selected
commands can be edited by the editor specified with the -e
option, or if no -e is specified, the $FCEDIT editor, then
executed by the shell.
fc -e - [-g] [old=new] [command]
Re-execute the selected command (the previous command by default)
after performing the optional substitution of old with new. If
-g is specified, all occurrences of old are replaced with new.
This command is usually accessed with the predefined alias r=``fc
-e -''.
getMatchPts [args]
Retrieves a list of points that match the specified criteria and
scope. Use the 'expr=' to specify the expression to match on.
The format of the expression is as follows:
'(' "and" <expr> [<expr>...] ')'
'(' "or" <expr> [<expr>...] ')'
'(' "not" <expr> ')'
'(' "classes" <integer> [<integer>...] ')'
'(' "categories" <integer> ')'
'(' "name" '"'<regexp>'"' ')'
'(' "alias" '"'<regexp>'"' ')'
'(' <attribute> [<op> <attribute>] ')'
'(' <attribute> [<op> '('<deType>')' '"'<string>'"'] ')'
where:
<expr> = one of the above
<integer> = integer
<regexp> = regular expression (see regexp(5))
<op> = '<', '<=', '>', '>=', '!=', '=='
<deType> = rtLOGICAL, rtUINT8, etc.
<string> = string value convertable to a value using rtStrToType(3).
<attribute> = attribute name of the form '[.attribute]'
anything enclosed in single quotes must be entered as is
anything enclosed in square brackets are optional
Some examples:
# matches all aliases
getMatchPts expr='(alias ".*")'
# match only aliases that start with "UIT"
getMatchPts expr='(alias "^UIT.*")'
# not class 1000, 1015, or 1020
getMatchPts expr='(not (classes 1000 1015 1020))'
# class 1015 points
getMatchPts expr='(classes 1015)'
# class 1015 and 1011 points
getMatchPts expr='(classes 1015 1011)'
# class 1015 and aliases that start with "UIT"
getMatchPts expr='(and (classes 1015) (alias "^UIT.*"))'
# class 1000 or aliases that start with "WELL"
getMatchPts expr='(or (classes 1000) (alias "^WELL.*"))'
# points with a ".raw value" greater than 10
getMatchPts expr='([.raw value] > (rtUINT32) "10")'
# points with a ".raw value" greater than or equal to
# "ABC.setpoint value"
getMatchPts expr='([.raw value] >= [ABC.setpoint value])'
# points with a ".raw value" less than "1.234"
getMatchPts expr='([.raw value] < (rtDOUBLE) "1.234")'
# points with a ".output value" equal to one
getMatchPts expr='([.output value] == (rtLOGICAL) "1")'
# points with a readable ".send output" attribute
getMatchPts expr='([.send output])'
Use the 'scopeType=' to specify the type of scope to use as
either
'rtDB_MATCH_SUBTREE', 'rtDB_MATCH_NTH_LEVEL',
'rtDB_MATCH_TO_NTH_LEVEL', or 'rtDB_MATCH_PAST_NTH_LEVEL'
(default = rtDB_MATCH_SUBTREE).
Use 'scopeLevel=' to specify the level number (default = 0).
Use 'pointListType=' to specify the return type as either 'PLIN'
or 'ALIAS' (default = PLIN). If 'ALIAS' is used, the alias names
will be printed with each one on a separate line. If 'PLIN' is
used, each PLIN will be printed with a space separating each one.
hash [-r] [name ...]
Without arguments, any hashed executable command pathnames are
listed. The -r flag causes all hashed commands to be removed.
Each name is searched as if it were a command name and added to
the hash table if it is an executable command.
kill [-signal] process ...
Send a signal (TERM by default) to the named process. The signal
may be specified as a number or a mnemonic from <signal.h> with
the SIG prefix removed.
let [expression ...]
Each expression is evaluated, see "Expressions" above. A zero
status is returned if the last expression evaluates to a non-zero
value, otherwise a non-zero status is returned. Since may
expressions need to be quoted, (( expr )) is syntactic sugar for
let "expr".
listEnv
Prints the environment name the shell is currently connected to.
logError [message]
Logs the last RTAP error to RtapMonitor. If message is specified
it will be used as the log message, otherwise no additional
message will be logged. Note that if the log message contains
white spaces, it must be enclosed in double quotes.
msgSend procName=process name procNum=proc num buffer=message
Sends the specified ASCII message to the specified process name
or process number. Only one of either procName or procNum should
be used. The message is sent with a priority of rtMINPRIO,
rtNO_RESPOND flag set, and a message type of rtASCII_MESSAGE. If
no arguments are specified, the call will prompt the user for the
process name/num and the message to send.
print [-nreun] [argument ...]
Print prints its arguments on the standard output, separated by
spaces, and terminated with a newline. The -n option eliminates
the newline.
By default, certain C escapes are translated. These include \b,
\f, \n, \r, \t, \v, and \### (# is an octal digit). \c is
equivalent to the -n option. This expansion may be inhibitted
with the -r option, and may be re-enabled with the addition of
the -e option.
nap [args]
Calls the RTAP routine rtNap(3) with the specified argument. The
argument specifies the number of micro-seconds to nap for. If no
argument is specified or if the argument does not contain a valid
number, the minimum nap time will be used (this is machine
dependant). Note that this call does not cause a fork and an
exec; instead the rtsh program itself is temporarily stopped.
openDh
Opens a data historian connection to the specified point (using
either the "name=" or "plin=" keywords). If a connection was
already open'ed to an existing data historian point, it will be
closed if the connection to the new data historian point was
successful.
printError
Causes the last RTAP error(s) to be printed to stderr. Note that
this command should only be used when an error has occurred
(usually when an RTAP command returns -1).
queryDb [args]
Allows database querys. If no arguments are specified then the
command will enter an interactive mode where all of the necessary
information for the command will be prompted for.
Non-interactive mode requires entering information in the form of
<keyword>=<value>. <keyword> is dependent upon the query action
to be performed. As a minimum the "action" keyword must be
specified to indicate what query action to perform. See "RTAP
Extensions" section.
queryDh [args]
Allows data historian querys. If no arguments are specified then
the command will enter an interactive mode where all of the
necessary information for the command will be prompted for.
Non-interactive mode requires entering information in the form of
<keyword>=<value>. <keyword> is dependent upon the query action
to be performed. As a minimum the "action" keyword must be
specified to indicate what query action to perform. See "RTAP
Extensions" section.
queryPlot [args]
Allows plot querys. If not arguments are specified then the
command will enter an interactive mode where all of the necessary
information for the command will be prompted for.
Non-interactive mode requires entering information in the form of
<keyword>=<value>. <keyword> is dependent upon the query action
to be performed. As a minimum the "action" keyword must be
specified to indicate what query action to perform. See "RTAP
Extensions" section.
querySs [args]
Allows scan system querys. If no arguments are specified then the
command will enter an interactive mode where all of the necessary
information for the command will be prompted for.
Non-interactive mode requires entering information in the form of
<keyword>=<value>. <keyword> is dependent upon the query action
to be performed. As a minimum the "action" keyword must be
specified to indicate what query action to perform. See "RTAP
Extensions" section.
read [-run] name ...
The first variable name may be of the form name?prompt.
readDb [args]
Reads value(s) from the RTAP database. The values are printed to
stdout. If no arguments are specified then the command will
enter an interactive mode where all of the necessary information
for the command will be prompted for.
Non-interactive mode requires entering information in the form of
<keyword>=<value>. See "RTAP Extensions" section.
readonly [name ...]
readSs
Currently implemented for interative mode only.
return [status]
schedule [args]
Concatinates all of the arg strings together and schedules the
resulting string through RtapScheduler(1) using the
rtScheduleProcess(3) call. The flag passed in will be
rtMERGE_RUNSTRING.
set [_[a-z]] [_o keyword] ...
Set (-) or clear (+) a shell option:
-a allexport all new variable are created with
export attribute
bgnice background jobs are run with lower
priority
emacs BRL emacs-like line editing
ignoreeof shell will not exit of EOF, must
use exit
-k keyword variable assignments are recognized
anywhere in command
markdirs [not implemented]
-m monitor job control enabled (default for
interactive shell)
-n noexec compile input but do not execute
(ignored if interactive)
-f noglob don't expand filenames
-r errexit exit on non-zero status [incorrect]
-u nounset dollar expansion of unset variables
is an error
-v verbose echo shell commands on stdout when
compiling
-h trackall add command pathnames to hash table
vi VI-like line editing
-x xtrace echo simple commands while
executing
set [--] arg ...
Set shell arguments.
setCwp
Prints the current working point in the RTAP database.
setCwp [name=database address]
Sets the current working point in the RTAP database. Both
database and scan system actions will be performed from the
specified database point. Note that the address can be specified
down to the attribute field level for a table, attribute record
level for a vector, and attribute level for a scalar.
setCwp [plin=database PLIN address]
Sets the current working point in the RTAP database. Both
database and scan system actions will be performed from the
specified database point.
setCwp [ain=database AIN address]
Sets the current working point in the RTAP database. Both
database and scan system actions will be performed from the
specified database point.
If the database address is not specified, the current working
point will be printed to stdout.
shift [number]
ssma Allows interactive actions to be performed on SSMA (Scan Shared
Memory Area). Note that this command is only available in
interactive mode (ie. no support for using in script files).
startNextPhase
Issues a start next phase command to RTAP.
times
tnCreatePtGroup [args]
Allows the creation of a point group as defined by the
dbBuildCreator(1) tool. If no arguments are specified then
the command will enter an interactive mode where all of the
necessary information for the command will be prompted for.
Non-interactive mode requires entering information in the form of
<keyword>=<value>. Valid <keyword>'s are:
"ptGroupName", "subStrs[0...]", and "rtuStr". See "RTAP
Extensions" section.
tnCreatePtType [args]
Allows the creation of a point type as defined by the
dbBuildCreator(1) tool. If no arguments are specified then
the command will enter an interactive mode where all of the
necessary information for the command will be prompted for.
Non-interactive mode requires entering information in the form of
<keyword>=<value>. Valid <keyword>'s are:
"ptTypeName" or "ptTypeClass", "buffer.aliasName", and
"buffer.pointName". See "RTAP Extensions" section.
trap [handler] [signal ...]
typeset [_irtx] [name[=value] ...]
If no arguments are given, lists all variables and their
attributes.
If options but no names are given, lists variables with specified
attributes, and their values if unless ``+'' is used.
If names are given, set the attributes of the named variables.
Variables may also be assigned a value. If used inside a
function, the created variable are local to the function.
The attributes are as follows. -iThe variable's value is stored
as an integer.
-xThe variable is exported to the environment.
-rThe variable is read-only cannot be reassigned a value.
-tTrace (not implemented).
-fList functions instead of variable.
ulimit [ - ] [ n ]
-c Impose a size limit of n blocks on the size of core dumps.
-d Impose a size limit of n blocks on the size of the data
area.
-f Impose a size limit of n blocks on files written by the
shell and its child processes (files of any size may be
read).
-m Impose a soft limit of n blocks on the size of physical
memory.
-t Impose a time limit of n seconds to be used by each process.
If no option is given, -f is assumed. If n is omitted, the
current limit is printed. As far as ulimit is concerned, a
``block'' is 512 bytes.
You may lower your own resource limit, but only a super-user
(see su(1M)) can raise a limit.
umask [value]
unalias name ...
The aliases for the given names are removed.
unset [-f] name ...
wait [process-id]
whence [-v] name ...
For each name, the type of command is listed. The -v flag causes
function and alias values to be listed.
writeDb [args]
Allows database writes. If no arguments are specified then the
command will enter an interactive mode where all of the necessary
information for the command will be prompted for.
Non-interactive mode requires entering information in the form of
<keyword>=<value>. See "RTAP Extensions" section.
writeSs
Currently implemented for interative mode only.
Job Control
Job control features are enabled by the -m or -o monitor flags. When
job control is enabled, and the system supports job control,
background commands and foreground commands that have been stopped
(usually by a SIGTSTP signal generated by typing ^Z) are placed into
separate individual process groups. The following commands are used
to manipulate these process groups:
jobs Display information about the controlled jobs. The job
number is given preceeded by a percent sign, followed
by a plus sign if it is the ``current job'', or by a
minus sign if it is the ``previous job'', then the
process group number for the job, then the command.
kill [-signal] job ...
Send a signal (TERM by default) to the named job
process group.
fg [ job ] Resume the stopped foreground job in the foreground.
If the process group n is not specified then the
``current job'' is resumed.
bg [ job ] Resume the stopped foreground job in the background.
If the process group n is not specified then the
``current job'' is resumed.
The fg, bg, kill, and wait commands may refer to jobs with the
following ``percent'' sequences. The percent sign is optional with
the fg and bg commands.
%+(%-) If there is a ``current job'' (``previous job''), then that
job is selected.
%n If the specified job number is one of the known jobs, then
that job is selected.
%string If the string matches the initial part of a job's command,
then that job is selected.
%?string As above, but the string may match any portion of the
command.
If the system does not support job control, monitor mode enables job
reporting. The jobs and kill commands functions as above, and you
will be informed when background jobs complete. Fg and bg are not
available.
Interactive Input Line Editing
When the emacs option is set, interactive input line editing is
enabled. This mode is slightly different from the emacs mode in
AT&T's KornShell. In this mode various editing commands (typically
bound to one or more control characters) cause immediate actions
without waiting for a new-line. Several editing commands are bound to
particular control characters when the shell is invoked; these
bindings can be changed using the following commands:
bind The current bindings are listed.
bind [ string ] = [ editing-command ]
The specified editing command is bound to the
given string, which should consist of a control
character (which may be written using ``caret
notation'' ^x), optionally preceded by one of the
two prefix characters. Future input of the string
will cause the editing command to be immediately
invoked.
Note that although only two prefix characters
(normal ESC and ^X) are supported, some multi-
character sequences can be supported:
bind '^[['=prefix-2
bind '^XA'=up-history
bind '^XB'=down-history
bind '^XC'=forward-char
bind '^XD'=backward-char
will bind the arrow keys on an ANSI terminal, or
xterm. Of course some escape sequences won't work
out quite that nicely.
bind -m [ string ] = [ substitute ]
The specified input string will afterwards be
immediately replaced by the given substitute
string, which may contain editing commands.
The following editing commands are available; first the command name
is given followed by its default binding (if any) using caret notation
(note that the ASCII ESC character is written as ^[), then the editing
function performed is described. Note that editing command names are
used only with the bind command. Furthermore, many editing commands
are useful only on terminals with a visible cursor. The default
bindings were chosen to resemble corresponding EMACS key bindings.
The users tty characters (eg. erase) are bound to reasonable
substitutes.
abort ^G Useful as a response to a request for
a search-history pattern in order to
abort the search.
auto-insert Simply causes the character to appear
as literal input. (Most ordinary
characters are bound to this.)
backward-char ^B Moves the cursor backward one
character.
backward-word ^[b Moves the cursor backward to the
beginning of a word.
beginning-of-line ^A Moves the cursor to the beginning of
the input line (after the prompt
string).
complete ^[^[ Automatically completes as much as is
unique of the hashed command name or
the file name containing the cursor.
If the entire remaining command or
file name is unique a space is printed
after its completion, unless it is a
directory name in which case / is
postpended. If there is no hashed
command or file name with the current
partial word as its prefix, a bell
character is output (usually causing a
``beep'').
complete-command ^X^[ Automatically completes as much as is
unique of the hashed command name
having the partial word up to the
cursor as its prefix, as in the
complete command described above.
Only command and function names seen
since the last hash -r command are
available for completion; the hash
command may be used to register
additional names.
complete-file ^[^X Automatically completes as much as is
unique of the file name having the
partial word up to the cursor as its
prefix, as in the complete command
described above.
copy-last-arg ^[_ The last word of the previous command
is inserted at the cursor. Note I/O
redirections do not count as words of
the command.
delete-char-backward ERASE Deletes the character before the
cursor.
delete-char-forward Deletes the character after the
cursor.
delete-word-backward ^[ERASE Deletes characters before the cursor
back to the beginning of a word.
delete-word-forward ^[d Deletes characters after the cursor up
to the end of a word.
down-history ^N Scrolls the history buffer forward one
line (later). Each input line
originally starts just after the last
entry in the history buffer, so down-
history is not useful until either
search-history or up-history has been
performed.
end-of-line ^E Moves the cursor to the end of the
input line.
eot ^_ Acts as an end-of-file; this is useful
because edit-mode input disables
normal terminal input
canonicalization.
eot-or-delete ^D Acts as eot if alone on a line;
otherwise acts as delete-char-forward.
exchange-point-and-mark ^X^X Places the cursor where the mark is,
and sets the mark to where the cursor
was.
forward-char ^F Moves the cursor forward one position.
forward-word ^[f Moves the cursor forward to the end of
a word.
kill-line KILL Deletes the entire input line.
kill-to-eol ^K Deletes the input from the cursor to
the end of the line.
kill-region ^W Deletes the input between the cursor
and the mark.
list ^[? Prints a sorted, columnated list of
hashed command names or file names (if
any) that can complete the partial
word containing the cursor. Directory
names have / postpended to them, and
executable file names are followed by
*.
list-command ^X? Prints a sorted, columnated list of
hashed command names (if any) that can
complete the partial word containing
the cursor.
list-file Prints a sorted, columnated list of
file names (if any) that can complete
the partial word containing the
cursor. File type indicators are
postpended as described under list
above.
newline ^J and ^M Causes the current input line to be
processed by the shell. (The current
cursor position may be anywhere on the
line.)
newline-and-next ^O Causes the current input line to be
processed by the shell, and the next
line from history becomes the current
line. This is only useful after an
up-history or search-history.
no-op QUIT Does nothing.
prefix-1 ^[ Introduces a 2-character command
sequence.
prefix-2 ^X Introduces a 2-character command
sequence.
quote ^^ The following character is taken
literally rather than as an editing
command.
redraw ^L Reprints the prompt string and the
current input line.
search-character ^] Search forward in the current line for
the next keyboard character.
search-history ^R Enter incremental search mode. The
internal history list is searched
backwards for commands matching the
input. An initial ``^'' in the search
string anchors the search. The escape
key will leave search mode. Other
commands will be executed after
leaving search mode (unless of course
they are prefixed by escape, in which
case they will almost certainly do the
wrong thing). Successive search-
history commands continue searching
backward to the next previous
occurrence of the pattern. The
history buffer retains only a finite
number of lines; the oldest are
discarded as necessary.
set-mark-command ^] Search forward in the current line for
the next keyboard character.
stuff On systems supporting it, pushes the
bound character back onto the terminal
input where it may receive special
processing by the terminal handler.
stuff-reset Acts like stuff, then aborts input the
same as an interrupt.
transpose-chars ^T Exchanges the two characters on either
side of the cursor, or the two
previous characters if the cursor is
at end of line.
up-history ^P Scrolls the history buffer backward
one line (earlier).
yank ^Y Inserts the most recently killed text
string at the current cursor position.
yank-pop ^[y Immediately after a yank, replaces the
inserted text string with the next
previous killed text string.
RTAP Extensions
This section describes the keywords used in the RTAP extensions.
Keywords used for the RTAP commands are specified in the form
<keyword>=<value> on the command line. Note that there is no space
between <keyword>, =, and <value>. <keyword> is usually the structure
parameter name. For example, for 'controlDb', 'queryDb', and
'configDb', the structure used is rtDbCq. One of the required
parameters for the rtDbCq structure is 'action'. Therefore, a
required command line argument is "action=". The <value> argument for
the 'action' keyword is the RTAP defined action without the preceding
command name. For example, the action rtQUERY_LRL would be specified
as "queryDb action=LRL". Note that the action value must be specified
in upper case.
Data element type values are specified using the RTAP definitions (for
example, rtLOGICAL, rtINT8, rtUINT8, etc.)
Values specified for the buffer, is specified using the structure
parameter name preceded by the "buffer." keyword. For example, the
'configDb action=ADD_SCALAR' command, 'buffer.common.name="\"scalar
attr\"" buffer.common.readGroups=1111 buffer.common.writeGroups=1111
buffer.deType=rtINT32' would be used to create an attribute named
"scalar attr" with both read and write groups all enabled and a data
element type of rtINT32. Note that strings must be enclosed in "'s
which must be escaped from the shell using the \ character.
General keywords are:
action=
Specifies the action to perform as defined by RTAP. The
command name is not specified (for example,
rtCONFIG_ADD_NULL_PT would be specified as
"action=ADD_NULL_PT").
buffer=
Specifies the buffer value. This keyword is only used when
specifying buffer values that are not structures (for
example, for the "configDb action=PT_CLASS" command,
"buffer=10000" would be used to set the point class to
10000).
name=
Specifies the database point that the action will be
performed on. If this keyword is not specified, the current
working point will be used. For actions that allow multiple
database addresses, this keyword can be specified multiple
times on the command line. The value specified must be a
symbolic name. If the database name contains spaces, the
name must be enclosed in "'s.
plin=
Specifies the PLIN that the action will be performed on. If
this keyword is not specified, the current working point
will be used. For actions that allow multiple database
addresses, this keyword can be specified multiple times on
the command line. The value specified must be a valid PLIN
number.
ain= Specifies the AIN that the action will be performed on. If
this keyword is not specified, the current working point
will be used. For actions that allow multiple database
addresses, this keyword can be specified multiple times on
the command line. The value specified must be a valid AIN
number.
RTAP Database Configuration
The configDb command will return 0 if the action was performed
successfully; otherwise it will return -1 with the RTAP errno set to
the cause of the error (see printError command). Note that if the
'name=' keyword is not specified, the current working point will be
used.
The tesserNet point types and point groups as created with
dbBuildCreator(1) can be created using the tnCreatePtType, and
tnCreatePtGroup commands. The point types and point groups are read
in from the configuration files on the first call to any of the
above commands. Note that the pre and post command scripts will be
run as specified in the point type and point group configuration.
If the pre-command script returns non-zero, the point type/group
will not be added. Note that for these commands, the database
configuration interlock will be set by the command; the user should
not set the configuration interlock prior to calling these
commands.
The following describes the valid keywords for each action:
action=ADD_FIELD
Token |
Description |
buffer.fields.name= |
Specifies new field name. |
buffer.fields.deType= |
Specifies the data element type. |
Only available with RTAP 7.0+.
action=ADD_NULL_PT
Token |
Description |
buffer.pointName= |
Specifies the point name. |
buffer.alias= |
Specifies the alias name. |
buffer.categories= |
Specifies the categories as a series of 32 0's or 1's (default =
all ones). |
buffer.residence= |
Specifies the residence as either rtRAM or rtDISK (default =
rtRAM). |
buffer.ceOperInd= |
Specifies the CE operation indicator as either rtCE_ENABLED,
rtCE_ENABLED_OPT_A, or rtCE_DISABLED (default = rtCE_ENABLED). |
buffer.exprOrder= |
Specifies the CE expression order as either rtNATURAL or
rtUSER_DEFINED (default = rtNATURAL). |
action=ADD_SCALAR
Token |
Description |
buffer.deType= |
Specifies the attribute's data element type. |
buffer.common.name= |
Specifies the name of the attribute (note that if the attribute
name contains spaces, it must be enclosed in "'s). |
buffer.common.writeGroups= |
Specifies the attribute's write groups as a series of 4 0's or
1's. |
buffer.common.readGroups= |
Specifies the attribute's read groups as a series of 4 0's or 1's. |
The default for the read and write groups is all 1's if not
specified.
action=ADD_TABLE
Token |
Description |
buffer.recordCnt= |
Specifies the number of records. |
buffer.fieldCnt= |
Specifies the number of fields. |
buffer.fields[i].name= |
Specifies the field name for field i (starting at zero). |
buffer.fields[i].deType= |
Specifies the data element type for field i (starting at
zero). |
buffer.common.name= |
Specifies the name of the attribute (note that if the attribute
name contains spaces, it must be enclosed in "'s). |
buffer.common.writeGroups= |
Specifies the attribute's write groups as a series of 4 0's or
1's. |
buffer.common.readGroups= |
Specifies the attribute's read groups as a series of 4 0's or 1's. |
The default for the read and write groups is all 1's if not
specified.
action=ADD_VECTOR
Token |
Description |
buffer.elemCnt= |
Specifies the number of elements. |
buffer.deType= |
Specifies the attribute's data element type. |
buffer.common.name= |
Specifies the name of the attribute (note that if the attribute
name contains spaces, it must be enclosed in "'s). |
buffer.common.writeGroups= |
Specifies the attribute's write groups as a series of 4 0's or
1's. |
buffer.common.readGroups= |
Specifies the attribute's read groups as a series of 4 0's or 1's. |
The default for the read and write groups is all 1's if not
specified.
action=ALIAS
Token |
Description |
buffer= |
Specifies the alias name. Note that if the alias name contains
spaces, it must be enclosed in "'s. |
action=ATTR_AIN
Token |
Description |
buffer= |
Specifies the new Attribute Index Number. If this value is not
specified, the next available number will be used. |
Only available with RTAP 7.0+.
action=ATTR_NAME
Token |
Description |
buffer= |
Specifies the name of the attribute. Note that if the attribute
name contains spaces, it must be enclosed in "'s. |
action=CATEGORIES
Token |
Description |
buffer= |
Specifies the categories as a series of 32 0's or 1's. |
action=COPY_ATTR
Token |
Description |
buffer.destPlin= |
Specifies the destination's PLIN number. |
buffer.newName= |
Specifies the attribute's name. If this token is not specified the
current attribute name will be used. |
action=COPY_BRANCH
Token |
Description |
buffer.newParent= |
Specifies the PLIN number of the new parent. |
buffer.newName= |
Specifies the new point name. If this token is not specified the
current point name will be used. |
action=COPY_POINT
Token |
Description |
buffer.newParent= |
Specifies the PLIN number of the new parent. |
buffer.newName= |
Specifies the new point name. If this token is not specified the
current point name will be used. |
action=DEFINITION
Token |
Description |
buffer= |
Specifies the attribute definition if it contains spaces, it must
be enclosed in "'s. If this token is not specified, a NULL
definition will be configured (i.e. the definition currently in the
database will be deleted). |
action=DE_TYPE
Token |
Description |
buffer= |
Specifies the data element type. |
Only available with RTAP 7.0+.
action=DEL_ATTR
Requires no additional tokens to be specified other than
name=. If not specified the current working point will be
used.
action=DEL_BRANCH
Requires no additional tokens to be specified other than
name=. If not specified the current working point will be
used.
action=DEL_BR_CHK
Requires no additional tokens to be specified other than
name=. If not specified the current working point will be
used.
action=DEL_FIELD
Requires no additional tokens to be specified other than
name=. If not specified the current working point will be
used.
Only available with RTAP 7.0+.
action=EXPR_ORDER
Token |
Description |
buffer= |
Specifies the CE expression order as either rtNATURAL or
rtUSER_DEFINED. |
action=GROUPS
Token |
Description |
buffer.writeGroups= |
Specifies the write groups as a series of 4 0's or 1's. |
action=FIELD_NAME
Token |
Description |
buffer= |
Specifies the new field name. |
Only available with RTAP 7.0+.
action=MOVE_POINT
Token |
Description |
buffer.newParent= |
Specifies the PLIN number of the new parent. |
buffer.newName= |
Specifies the new point name. If this token is not specified, the
current name will be used. |
action=PT_CLASS
Token |
Description |
buffer= |
Specifies the point class. |
action=PT_NAME
Token |
Description |
buffer= |
Specifies the point name. Note that if the point name contains
spaces, it must be enclosed in "'s. |
action=RECEL_CNT
Token |
Description |
buffer= |
Specifies the record count. |
action=RECEL_CNT_CHECK
Token |
Description |
buffer= |
Specifies the record count. |
action=RESIDENCE
Token |
Description |
buffer= |
Specifies the residence as either rtRAM or rtDISK. |
tesserNet Point Type/Group
The tnCreatePtType and tnCreatePtGroup commands allow the creation
of point types/groups that have been defined by the
dbBuildCreator(1) tool. For both commands, the optional name=
keyword can be used to specify the parent point. If this keyword
is not specified, the current working point will be used as the
parent.
Valid keywords for the tnCreatePtGroup command are:
Token |
Description |
ptGroupName= |
Specifies the name of the point group to create. |
subStrs[i]= |
Specifies the sub-string for index i (starting at zero).
The number of sub-strings is dependant on the point group. |
rtuStr= |
Specifies the scan device alias for the point group. Note that not
all point groups require this. |
For the tnCreatePtType command, one of ptTypeName=
or ptTypeClass= must be specified.
Valid keywords for the tnCreatePtType command are:
Token |
Description |
ptTypeName= |
Specifies the name of the point type to create. |
ptTypeClass= |
Specifies the class of the point type to create. |
buffer.aliasName= |
Specifies the alias name of the new point. |
buffer.pointName= |
Specifies the point name of the new point. |
RTAP Database Query
The queryDb command will return -1 with the RTAP errno set to the
cause of the error (see printError command) if the command fails. See
the individual actions for a successful return value. Note that if
the name= keyword is not specified, the current working point will be
used. The following describes the valid keywords for each action:
action=ALIAS
Prints the alias name to stdout. Returns zero if successful.
action=ALPHA_ATTRS
Prints the AIN number followed by the attribute name
separated by a tab character, with each attribute on one
line. Returns the number of attributes if successful.
action=ATTRIBUTE
Prints the rtQueryAttribute structure members to stdout,
with each member on a line. Returns zero if successful.
action=ATTR_ACCESS
Prints the read access and write access value as an integer
to stdout. Returns zero if successful.
action=ATTR_CNT
Prints the attribute count to stdout. Returns zero if
successful.
action=ATTR_IDS
Prints the AIN numbers to stdout, with each AIN on a line.
Returns the number of AIN's if successful.
action=ATTR_NAME
Prints the attribute name to stdout. Returns zero if
successful.
action=ATTR_NAMES
Prints the attribute name(s) to stdout, with one name per
line. Returns zero if successful.
action=ATTR_ORDER
Prints the attribute order list (a list of AIN's) to stdout,
with each AIN listed on a line. Returns zero if successful.
action=ATTR_QUALITY
Prints the attributes quality to stdout as a numeric number.
The number is consistent with RTAP's quality values.
action=CATEGORIES
Prints the category out to stdout as an unsigned integer.
Returns zero if successful.
action=CATEG_NAMES
Prints the category names to stdout, with one category name
per line. Returns zero if successful.
action=CFI
Prints out the following information to stdout, separated by
a tab character:
- interlock type (0=read, 1=config),
- number of interlocks,
- process ID of process holding the lock,
- process name holding the lock,
- RTAP process number of process holding the lock,
- if the process has terminated (0=still running, 1=terminated), and
- time of the lock.
action=CE_DEP_REF
Prints the PLIN number of the point(s) that contain CE
expressions that reference the point to stdout. Returns the
number of points if successful.
action=CE_DEP_UPD
Prints the PLIN number of the point(s) that would cause the
CE to update to stdout. Returns the number of points if
successful.
action=CE_OPER
Prints the CE operation indicator to stdout as an integer.
Returns zero if successful.
action=CONN_INFO
Prints the rtQueryConnInfo structure to stdout, with one
member per line. Returns zero if successful.
action=DEFINITION
Prints the definition to stdout. Returns zero if successful.
action=DE_TYPE
Prints the data element type(s) to stdout. Each data element
type is printed on a single line. Returns the number of data
element types.
action=DIRECT
Prints the rtQueryDbDirect structure to stdout. Returns zero
if successful.
action=DIRECT_ATTR
Prints the rtQueryDbDirect structure to stdout. Returns zero
if successful.
action=EVENT
Prints the event(s) for the attribute as an integer. Returns
zero if successful.
action=EXPR_ORDER
Print the CE expression order to stdout as an integer.
Returns zero if successful.
action=FIELD_NAMES
Prints the field names to stdout, with each field name on a
line. Returns zero if successful.
action=FIRST_CHILD
Prints the PLIN number of the first child to stdout. Returns
zero if successful.
action=GROUPS
Prints the read and write groups for the attribute as
integers to stdout. Returns zero if successful.
action=GROUP_NAMES
Prints the group names to stdout, with one group name per
line. Returns zero if successful.
action=LRL
Prints the PLIN number of each child to stdout, with one
PLIN per line. Returns the number of children is
successful.
action=NEXT_SIBLING
Prints the PLIN number of the next child to stdout. Returns
zero if successful.
action=PARENT
Prints the PLIN number of the parent to stdout. Returns zero
if successful.
action=PT_CLASS
Prints the point class to stdout. Returns zero if
successful.
action=PT_NAME
Prints the point name to stdout. Returns zero if successful.
action=PTS_IN_CATEG
Use the buffer.categories= token to specify the point
categories as a series of 32 0's or 1's. Prints the PLIN
number of all database points that belong to the specified
categories to stdout. Returns the number of points if
successful.
action=PTS_IN_CLASS
Use the buffer.pointClass= token to specify the point class.
Prints the PLIN number of all database points that belong to
the specified class to stdout. Returns the number of points
if successful.
action=RESIDENCE
Prints the point residence to stdout as an integer. Returns
zero if successful.
action=SPACE
Prints the database sizes to stdout. Each group is printed
as the maximum used followed by a tab character followed by
the total size. This is repeated for the header space, RAM
space, disk space, points, and types. Returns zero is
successful.
action=SYM_ABS
Prints the symbolic address to stdout. Returns zero if
successful.
action=SYM_ALIAS
Prints the symbolic address to stdout. Returns zero if
successful.
action=SYM_REL
Prints the symbolic address to stdout. Returns zero if
successful.
action=USAGE
Print the usage list to stdout, as the AIN followed by the
usage number separated by a tab character on one line.
Returns the usage list count if successful.
action=USAGE_NAMES
Print the usage names to stdout. Returns zero if successful.
Note this action is only available for RTAP 7.0+.
RTAP Database Control
The controlDb command will return 0 if the action was performed
successfully; otherwise it will return -1 with the RTAP errno set to
the cause of the error (see printError command). Note that if the
name= keyword is not specified, the current working point will be
used. The following describes the valid keywords for each action:
action=ADD_USAGE
Token |
Description |
buffer.usageCnt= |
Specifies the number of usage(s) to add. |
buffer.usageList[i].ain= |
Specifies the AIN number for count i (starting at zero). |
buffer.usageList[i].usageType= |
Specifies the usage number for count i (starting at zero). |
action=CE_OPER
Token |
Description |
buffer= |
Specifies the CE operation indicator as either rtCE_ENABLED,
rtCE_DISABLED, rtCE_DISABLED_NO_RUN, or rtCE_ENABLED_OPT_A. |
action=CLR_CFI
No additional tokens are required. Will attempt to clear all
of the configuration interlocks currently held by a
terminated process. The return value, indicates how many
locks were released. Note that even if the value returned is
-1, some locks may have been released. The error return
code, just indicates that an error occurred while attempting
to release one or more locks.
action=DEL_USAGE
Token |
Description |
buffer.usageCnt= |
Specifies the number of usage(s) to delete. |
buffer.usageList[i].ain= |
Specifies the AIN number for count i (starting at zero). |
buffer.usageList[i].usageType= |
Specifies the usage number for count i (starting at zero). |
action=DISABLE_SNAPS
Requires no additional tokens.
action=ENABLE_SNAPS
Requires no additional tokens.
action=LOCK_PT
Token |
Description |
buffer.tv_sec= |
Specifies the number of seconds. |
buffer.tv_usec= |
Specifies the number of micro-seconds. |
These two tokens are optional.
action=RDR_CFI
Token |
Description |
attempts= |
Specifies the number of attempts to try to set the read
configuration interlock (default = 1). |
timeout= |
Specifies the time to wait in between attempts in milli-seconds
(default = 1000). |
action=REL_CFI
Requires no additional tokens.
action=REUSE_PLINS
Token |
Description |
buffer.plinCnt= |
Specifies the number of PLIN's. |
buffer.plins[i]= |
Specifies the PLIN numbers for count i (starting at zero). |
action=RUN_CE
Requires no additional tokens to be specified other than
name=. If not specified the current working point will be
used.
action=SET_CFI
Token |
Description |
attempts= |
Specifies the number of attempts to try to set the read
configuration interlock (default = 1). |
timeout= |
Specifies the time to wait in between attempts in milli-seconds
(default = 1000). |
action=SET_CWP
Token |
Descrption |
name= |
Specifies the database address of where to set the current working
point to. |
action=SET_USAGE
Token |
Description |
buffer.usageCnt= |
Specifies the number of usage(s) to set. |
buffer.usageList[i].ain= |
Specifies the AIN number for count i (starting at zero). |
buffer.usageList[i].usageType= |
Specifies the usage number for count i (starting at zero). |
action=SNAPSHOT
Token |
Description |
buffer= |
Specifies the snapshot type as either rtCURRENT_SNAP or
rtFORE_GND_SNAP (default = rtCURRENT_SNAP). |
action=UNLOCK_PT
Requires no additional tokens to be specified other than
name=. If not specified the current working point will be
used.
action=XFER_LOCK
Token |
Description |
buffer.procNum= |
Specifies the process number. |
buffer.lockTime.tv_sec= |
Specifies the number of seconds. |
buffer.lockTime.tv_usec= |
Specifies the number of micro-seconds. |
RTAP Database Reads
The readDb command will return 0 if the action was performed
successfully; otherwise it will return -1 with the RTAP errno set to
the cause of the error (see printError command). Note that if the
name= keyword is not specified, the current working point will be
used. For scalar attributes, the value will be printed to stdout. For
vector attributes, the value(s) will printed to stdout as one value
per line. For table attributes, the value(s) will be printed to
stdout with fields separated by tab characters, and one record per
line.
RTAP Database Writes
The writeDb command will return 0 if the action was performed
successfully; otherwise it will return -1 with the RTAP errno set to
the cause of the error (see printError command). Note that if the
name= keyword is not specified, the current working point will be
used. Use the buffer= token to specify the value(s). For vectors,
each value is separated by a carriage return. To do this, enclose the
value(s) in "'s. For tables, each field value is separated by , and
each record is separated by a carriage return. To do this, enclose the
value(s) in "'s.
RTAP Scan System Query
The querySs command will return 0 if the action was performed
successfully; otherwise it will return -1 with the RTAP errno set to
the cause of the error (see printError command). Note that if the
name= keyword is not specified, the current working point will be
used. The following describes the valid keywords for each action:
action=SCAN_TASK_STATE
Requires no additional tokens to be specified other than the
name=. If not specified the current working point will be
used.
action=SS_STATE
Prints the scan system state as an integer to stdout.
RTAP Scan System Control
The controlSs command will return 0 if the action was performed
successfully; otherwise it will return -1 with the RTAP errno set to
the cause of the error (see printError command). Note that if the
name= keyword is not specified, the current working point will be
used. The following describes the valid keywords for each action:
action=COLD_RST_DEVICE
Token |
Description |
name= |
Specifies the scan device to cold restart. |
If more than one scan device is specified, the return value
indicates the number of failures.
action=COMM_PORT_MODE
Token |
Description |
buffer.cpModeStat[i].mode= |
Specifies the mode as either rtPOLLED_PRBX, rtPOLLED_PRBX_SRBX, or
rtSRBX. If more than one value is specified, it corresponds to the i'th
occurance of the name= token; otherwise if only
one value is specified (i.e. i is equal to zero) and the name=
token is not specified, the current working point will be used. |
action=DISABLE_CP
Token |
Description |
name= |
Specifies the communication ports to disable. If more than one
port is specified, the return value indicates the number of
failures. |
action=DISABLE_SD_SI
Token |
Description |
name= |
Specifies the scan device to disable. If more than one scan device
is specified, the return value indicates the number of failures. |
action=DISABLE_SD_SI_PT
Token |
Description |
name= |
Specifies the scan device scan input point to disable. If more
than one scan device scan input point is specified, the return value
indicates the number of failures. |
action=DISABLE_SD_SO
Token |
Description |
name= |
Specifies the scan device to disable. If more than one scan device
is specified, the return value indicates the number of failures. |
action=DISABLE_SD_SO_PT
Token |
Description |
name= |
Specifies the scan device scan output point to disable. If more
than one scan device scan output point is specified, the return
value indicates the number of failures. |
action=DISABLE_SS
Requires no additional tokens.
action=ENABLE_CP
Token |
Description |
name= |
Specifies the communication ports to enable. If more than one port
is specified, the return value indicates the number of failures. |
action=ENABLE_SD_SI
Token |
Description |
name= |
Specifies the scan device to enable. If more than one scan device
is specified, the return value indicates the number of failures. |
action=ENABLE_SD_SI_PT
Token |
Description |
name= |
Specifies the scan device scan input point to enable. If more than
one scan device scan input point is specified, the return value
indicates the number of failures. |
action=ENABLE_SD_SO
Token |
Description |
name= |
Specifies the scan device to enable. If more than one scan device
is specified, the return value indicates the number of failures. |
action=ENABLE_SD_SO_PT
Token |
Description |
name= |
Specifies the scan device scan output point to enable. If more
than one scan device scan output is specified, the return value
indicates the number of failures. |
action=ENABLE_SS
Requires no additional tokens.
action=FORCE_POLL
Token |
Description |
name= |
Specifies the scan device to force a poll on. If more than one
scan device is specified, the return value indicates the number of
failures. |
action=FORCE_POLL_TYPE
Token |
Description |
buffer.typeStat[i].pType= |
Specifies the poll type. The value should be specified using the
(0x)00000000 format. If more than one value is specified, it
corresponds to the i'th occurance of the name=
token; otherwise if only one value is specified (i.e. i is
equal to zero) and the name= token is not
specified, the current working point will be used. |
action=FORCE_PRBX
Token |
Description |
name= |
Specifies the scan device to force a PRBX on. If more than one
scan device is specified, the return value indicates the number of
failures. |
action=FORCE_PRBX_TYPE
Token |
Description |
buffer.typeStat[i]pType= |
Specifies the PRBX type. The value should be specified using the
(0x)00000000 format. If more than one value is specified, it
corresponds to the i'th occurance of the name=
token; otherwise if only one value is specified (i.e. i is
equal to zero) and the name= token is not
specified, the current working point will be used. |
action=POLL_PERIOD
Token |
Description |
buffer.prdStat[i].pPeriod= |
Specifies the poll period in seconds. |
buffer.prdStat[i].pType= |
Specifies the poll type to change (in the range 0-31). |
If more than one value is specified, it corresponds to the
i'th occurance of the name= token; otherwise if only one
value is specified (ie. i is equal to zero) and the name=
token is not specified, the current working point will be
used.
action=POLL_PERIOD_MS
Token |
Description |
buffer.prdStat[i]pPeriodSec= |
Specifies the poll period in seconds. |
buffer.prdStat[i].pPeriodMSec= |
Specifies the poll period in milli-seconds. |
buffer.prdStat[i].pType= |
Specifies the poll type to change (in the range 0-31). |
If more than one value is specified, it corresponds to the
i'th occurance of the name= token; otherwise if only one
value is specified (ie. i is equal to zero) and the name=
token is not specified, the current working point will be
used.
action=POLL_TYPE
Token |
Description |
buffer.typeStat[i].pType= |
Specifies the poll type. The value should be specified using the
(0x)00000000 format. If more than one value is specified, it
corresponds to the i'th occurance of the name=
token; otherwise if only one value is specified (i.e. i is
equal to zero) and the name= token is not
specified, the current working point will be used. |
action=PRBX_PERIOD
Token |
Description |
buffer.prdStat[i].pPeriod= |
Specifies the PRBX period in seconds. |
buffer.prdStat[i].pType= |
Specifies the PRBX type to change (in the range 0-31). |
If more than one value is specified, it corresponds to the
i'th occurance of the name= token; otherwise if only one
value is specified (ie. i is equal to zero) and the name=
token is not specified, the current working point will be
used.
action=PRBX_PERIOD_MS
Token |
Description |
buffer.prdStat[i].pPeriodSec= |
Specifies the PRBX period in seconds. |
buffer.prdStat[i].pPeriodMSec= |
Specifies the PRBX period in milli-seconds. |
buffer.prdStat[i].pType= |
Specifies the PRBX type to change (in the range 0-31). |
If more than one value is specified, it corresponds to the
i'th occurance of the name= token; otherwise if only one
value is specified (ie. i is equal to zero) and the name=
token is not specified, the current working point will be
used.
action=PRBX_TYPE
Token |
Description |
buffer.typeStat[i].pType= |
Specifies the PRBX type. The value should be specified using the
(0x)00000000 format. If more than one value is specified, it
corresponds to the i'th occurance of the name=
token; otherwise if only one value is specified (i.e. i is
equal to zero) and the name= token is not
specified, the current working point will be used. |
action=PRIORITY_POLL
Token |
Description |
name= |
Specifies the scan device to force a priority poll on. If more
than one scan device is specified, the return value indicates the
number of failures. |
action=PRIORITY_POLL_TYPE
Token |
Description |
buffer.typeStat[i].pType= |
Specifies the poll type. The value should be specified using the
(0x)00000000 format. If more than one value is specified, it
corresponds to the i'th occurance of the name=
token; otherwise if only one value is specified (i.e. i is
equal to zero) and the name= token is not
specified, the current working point will be used. |
action=SET_TIME
Requires no additional tokens|to be specified other than the
name=. If not specified the current working point will be
used.
action=SNAP
Requires no additional tokens|to be specified other than the
name=. If not specified the current working point will be
used.
action=SNAP_WITH_VERIFY
Requires no additional tokens|to be specified other than the
name=. If not specified the current working point will be
used.
action=WARM_RST_DEVICE
Token |
Description |
name= |
Specifies the scan device warm restart. If more than one scan
device is specified, the return value indicates the number of
failures. |
RTAP Data Historian Query
The queryDh command will return 0 if the action was performed
successfully; otherwise it will return -1 with the RTAP errno set to
the cause of the error (see printError command). Note that all actions
are performed on the current data historian point (see openDh). The
following describes the valid keywords for each action:
action=AUTOARM
Prints the data historian table's autoarm state as a number.
action=AUTOREARM
Use the buffer.setupNumber= token to specify the setup
number in which the auto-rearm status is required. Prints
the auto-rearm status as a number.
action=DATAWRAP
Prints the data historian table's data wrap status as a
number.
action=OUTPUT_TRIGGER
Prints the following information, separated by a tab
character:
- database address of the output trigger
- output trigger state as a number
action=RECORD_DATA
Prints the database address of the record data one per line.
action=SETUP
Token |
Description |
buffer.setupNumber= |
Specifies the setup number in which the setup information is
required. |
Prints the following information, seperated by a tab
character:
- setup enable status (as a number)
- setup status (as a number)
- setup start condition (as a number)
if the start condition is:
rtDH_SETUP_START_TIMED - the start time is printed
rtDH_SETUP_START_EVENT - the trigger states
if the trigger state is:
rtDH_EV_TRIG_ADDR - the trigger database address is
printed
- setup sample period
- setup sample type (as a number)
- setup stop condition (as a number)
if the stop condition is:
rtDH_STOP_TIMED - the stop period and stop period type is
printed
rtDH_STOP_EVENT - the trigger states and the trigger database
address is printed
rtDH_STOP_COUNT - the stop count is printed
- setup auto-rearm status (as a number)
action=SETUP_NUM
Prints the number of setups for this data historian table.
action=SETUP_STATUS
Token |
Description |
buffer.setupNumber= |
Specifies the setup number in which the setup status is required. |
Prints the setup status as a number.
action=SOURCE_COUNT
Prints the number of sources for the data historian table.
action=STATISTICS
Prints the following information, separated by a tab
character:
- average time
- average count
- average state (as a number)
if the average state is:
rtDH_STATE_TIME_AVG - the time average type (as a number) is
printed
action=TABLE_CONFIG
The following information is printed, separated by a tab character:
- next record
- remaining samples
- lap counter
- clear counter
- table status (as a number)
- average time
- average count
- average state (as a number)
if the average state is:
rtDH_STATE_TIME_AVG - the time average type (as a number) is
printed
- output trigger database address
- output trigger state (as a number)
- auto arm state (as a number)
- auto wrap state (as a number)
- each of the record data database address(es)
action=TABLE_CONN_PLIN
Prints the table PLIN.
action=TABLE_LIST
Prints each of the data historian table's PLIN. Note that
this can only be called on the "historian config" table.
When run in interactive mode, the list will be printed using
symbolic names.
action=TABLE_LIST_CNT
Prints the number of data historian table(s). Note that this
can only be called on the "historian config" table.
action=TABLE_NAME
Prints the history table's name.
action=TABLE_RESIDENCE
Prints the history table's database residence (as a number).
action=TABLE_SIZE
Prints the number of records for the history table.
action=TABLE_STATE
Prints the following information, separated by a tab
character:
- next record
- remaining samples
- lap counter
- clear counter
- table status (as a number)
RTAP Data Historian Control
The controlDh command will return 0 if the action was performed
successfully; otherwise it will return -1 with the RTAP errno set to
the cause of the error (see printError command). Note that all actions
are performed on the current data historian point (see openDh). For
all control actions, no further information is required. The
following describes the valid keywords for each action:
action=AUTOARM_ENABLE
Sets the autoarm state to enabled.
action=AUTOARM_DISABLE
Sets the autoarm state to disabled.
action=DATAWRAP_ENABLE
Sets the datawrap state to enabled.
action=DATAWRAP_DISABLE
Sets the datawrap state to disabled.
action=ARM_TABLE
Sets the data historian table into the arm state.
action=DISARM_TABLE
Sets the data historian table into the disarm state.
action=ENABLE_TABLE
Sets the data historian table into the enable state.
action=DISABLE_TABLE
Sets the data historian table into the disable state.
action=ONESHOT_TABLE
Instructs the data historian manager to take a single
sample.
action=CLEAR_TABLE
Clears all data from the history table.
Rtap Data Historian Config
The configDh command will return 0 if the action was performed
successfully; otherwise it will return -1 with the RTAP errno set to
the cause of the error (see printError command). Note that all actions
are performed on the current data historian point (see openDh). The
following describes the valid keywords for each action:
action=ADD_TABLE_POINT
Token |
Description |
buffer.pointName= |
Specifies the table's point name. |
buffer.alias= |
Specifies the table's alias name. |
buffer.parentPoint= |
Specifies the parent's alias name. |
buffer.residence= |
Specifies the table's residence as either rtRAM or rtDISK (default
= rtRAM). |
buffer.recordItemCnt= |
Specifies the number of record items. |
buffer.userStatsCnt= |
Specifies the number of user statistics (default = 0). |
buffer.recordCnt= |
Specifies the number of records for the history table. |
buffer.recordItems[i].name= |
Specifies the field name for record item i (starting at
zero). |
buffer.recordItems[i].deType= |
Specifies the data element type for the record item i
(starting at zero). |
buffer.userStats[i].name= |
Specifies the field name for user statistics item i
(starting at zero). |
buffer.userStats[i].deType= |
Specifies the data element type for user statistics item i
(starting at zero). |
action=AUTOREARM
Token |
Description |
buffer.setupNumber= |
Specifies which setup to configure (either 1 or 2). |
buffer.state= |
Specifies the auto-re-arm state as either rtDH_DISABLE_STATE or
rtDH_ENABLE_STATE. |
action=COPY_ABS_POINT
Token |
Description |
buffer.copyPoint.newParent= |
Specifies the PLIN number of the new parent. |
buffer.copyPoint.newName= |
Specifies the new point name (default = same as copied point). |
buffer.newAlias= |
Specifies the new alias name. |
action=COPY_REL_POINT
Token |
Description |
buffer.copyPoint.newParent= |
Specifies the PLIN number of the new parent. |
buffer.copyPoint.newName= |
Specifies the new point name (default = same as copied point). |
buffer.newAlias= |
Specifies the new alias name. |
action=DELETE_TABLE_POINT
No other tokens are required.
action=OUTPUT_TRIGGER
Token |
Description |
buffer.trigAddr= |
Specifies the symbolic address of the output trigger. |
buffer.state= |
Specifies the trigger state as either rtDH_DISABLE_STATE or
rtDH_ENABLE_STATE. |
action=RECORD_DATA
Token |
Description |
buffer.item[i]= |
Specifies the new record item for field i starting at
record item zero. All other items will be retained. |
action=SETUP
Token |
Description |
buffer.setupNumber= |
Specifies the setup number to use (either 1 or 2). |
buffer.setup.setupEnable= |
Specifies the setup enable status (either rtDH_DISABLE_STATE or
rtDH_ENABLE_STATE (default = rtDH_ENABLE_STATE). |
buffer.setup.startCondition= |
Specifies the start condition as either rtDH_SETUP_START_ARMED,
rtDH_SETUP_START_TIMED, or rtDH_SETUP_START_EVENT. |
buffer.setup.startTime.year= |
If the start condition is rtDH_SETUP_START_TIMED, this token
specifies the start year (default = rtWILD). |
buffer.setup.startTime.month= |
If the start condition is rtDH_SETUP_START_TIMED, this token
specifies the start month (default = rtWILD). |
buffer.setup.startTime.day= |
If the start condition is rtDH_SETUP_START_TIMED, this token
specifies the start day (default = rtWILD). |
buffer.setup.startTime.hour= |
If the start condition is rtDH_SETUP_START_TIMED, this token
specifies the start hour (default = rtWILD). |
buffer.setup.startTime.minute= |
If the start condition is rtDH_SETUP_START_TIMED, this token
specifies the start minute (default = rtWILD). |
buffer.setup.startTime.second= |
If the start condition is rtDH_SETUP_START_TIMED, this token
specifies the start second (default = 0). |
buffer.setup.startTime.usec= |
If the start condition is rtDH_SETUP_START_TIMED, this token
specifies the start micro-seconds (default = 0). |
buffer.setup.triggerStates= |
If the start condition is rtDH_SETUP_START_EVENT, this token
specifies the start event state as either rtDH_EV_TRIG_ALL or
rtDH_EV_TRIG_ADDR. If both event types are to be used use the '|'
symbol between them (ie. rtDH_EV_TRIG_ALL|rtDH_EV_TRIG_ADDR). |
buffer.setup.startTriggerStates= |
If the start condition is rtDH_SETUP_START_EVENT, this token
specifies the start event states as either <, >, ==, <=,
>=, or !=. |
bufer.setup.startTrigAddr= |
If the start condition is rtDH_SETUP_START_EVENT, this token
specifies the event trigger address (symbolic). |
buffer.setup.sampleType= |
Specifies the sample type as either rtDH_SAMPLE_DAYS,
rtDH_SAMPLE_HOURS, rtDH_SAMPLE_MINUTES, or rtDH_SAMPLE_SECONDS. |
buffer.setup.samplePeriod= |
Specifies the sample period. |
buffer.setup.stopCondition= |
Specifies the stop condition as either rtDH_STOP_NONE,
rtDH_STOP_TIMED, rtDH_STOP_EVENT or rtDH_STOP_COUNT. |
buffer.setup.stopType= |
If the stop condition is rtDH_STOP_TIMED, this token specifies the
stop type as either rtDH_STOP_DAYS, rtDH_STOP_HOURS,
rtDH_STOP_MINUTES or rtDH_STOP_SECONDS. |
buffer.setup.stopPeriod= |
If the stop condition is rtDH_STOP_TIMED, this token specifies the
stop period. |
buffer.setup.stopTriggerStates= |
If the stop condition is rtDH_STOP_EVENT, this token specifies the
stop event states as either <, >, ==, <=, >=, or !=. |
buffer.setup.stopTrigAddr= |
If the stop condition is rtDH_STOP_EVENT, this token specifies the
stop event address (symbolic). |
buffer.setup.stopCount= |
If the stop condition is rtDH_STOP_COUNT, this token specifies the
stop count. |
buffer.setup.autoReArm= |
Specifies the auto re-arm state as either rtDH_DISABLE_STATE or
rtDH_ENABLE_STATE (default = rtDH_DISABLE_STATE). |
action=STATISTICS
Token |
Description |
buffer.state= |
Specifies the statistics state as either rtDH_STATS_MIN_MAX,
rtDH_STATS_CNT_AVG, or rtDH_STATS_TIME_AVG. Multiple states can be
specified by using the them. |
buffer.avgTime= |
If the state includes rtDH_STATS_TIME_AVG, this token specifies
the average time value. |
buffer.statType= |
If the state includes rtDH_STATS_TIME_AVG, this token specifies
the type as either rtDH_STAT_DAYS, rtDH_STAT_HOURS,
rtDH_STAT_MINUTES, or rtDH_STAT_SECONDS. |
buffer.avgCount= |
If the state includes rtDH_STATS_CNT_AVG, this token specifies the
average count value. |
action=TABLE_NAME
Token |
Description |
buffer= |
Specifies the new table name. |
action=TABLE_RESIDENCE
Token |
Description |
buffer= |
Specifies the new residence as either rtRAM or rtDISK. |
action=TABLE_SIZE
Token |
Description |
buffer= |
Specifies the number of records for this history table. |
RTAP Plot Query
The queryPlot command will return 0 if the action was performed
successfully; otherwise it will return -1 with the RTAP errno set to
the cause of the error (see printError command). Note that if the
'name=' keyword is not specified, the current working point will be
used.
The following keywords are used to indicate which plot display process
to send query actions to.
plotDisplayName=
Specifies the plot display's process name (default =
RtapPlotDisp).
plotDisplayEnv=
Specifies the plot display's environment name (default =
current environment).
The following describes the valid keywords for each action:
action=GET_CONTEXT
Prints the following out on a separate line:
- run time environment name
- configuration environment name
- data environment name
- display name
action=GET_VIEW_STATUS
Prints the view status for the specified plot.
RTAP Plot Configuration
The configPlot command will return 0 if the action was performed
successfully; otherwise it will return -1 with the RTAP errno set to
the cause of the error (see printError command). Note that if the
'name=' keyword is not specified, the current working point will be
used. The following describes the valid keywords for each action:
action=COPY_POINT_ABSOLUTE
action=COPY_POINT_RELATIVE
Token |
Description |
buffer.parentPlot= |
Specifies the parent plot's alias name. |
buffer.parentPoint= |
Specifies the parent alias name. |
buffer.newAlias= |
Specifies the new alias name (optional). |
buffer.newName= |
Specifies the new point name (optional). |
action=DELETE_POINT
Requires no additional tokens to be specified other than
name=. If not specified the current working point will be
used.
action=MOVE_POINT_ABSOLUTE
Token |
Description |
buffer.parentPlot= |
Specifies the parent plot's alias name. |
buffer.parentPoint= |
Specifies the parent alias name. |
action=BEGIN_BRANCH_COPY
action=END_BRANCH_COPY
Requires no additional tokens.
RTAP Plot Control
The controlPlot command will return 0 if the action was performed
successfully; otherwise it will return -1 with the RTAP errno set to
the cause of the error (see printError command). Note that if the
name= keyword is not specified, the current working point will be
used.
The following keywords are used to indicate which plot display process
to send control actions to.
plotDisplayName=
Specifies the plot display's process name (default =
RtapPlotDisp).
plotDisplayEnv=
Specifies the plot display's environment name (default =
current environment).
The following describes the valid keywords for each action:
action=COPY_PLOT
Token |
Description |
buffer.copyName= |
Specifies the name to give to the copied point. |
action=COPY_PLOT_UNDER
Token |
Description |
buffer.parentPlot= |
Specifies the parent plot's alias name. |
buffer.parentPoint= |
Specifies the parent alias name. |
buffer.copyName= |
Specifies the name to give to the copied point. |
action=CLOSE_VIEW
action=CONFIGURE_PLOT
action=DELETE_PLOT
action=ICONIFY_VIEW
action=OPEN_VIEW
action=PRINT_PLOT
action=SET_LIST_BY_PARENT
action=SET_LIST_BY_SIBLING
action=UNICONIFY_VIEW
action=RAISE_VIEW
action=LOWER_VIEW
Requires no additional tokens to be specified other than
name=. If not specified the current working point will be
used.
action=HOUR_GLASS_OFF
action=HOUR_GLASS_ON
action=ICONIFY
action=REFRESH
action=UNICONIFY
action=RAISE
action=LOWER
Requires no additional tokens.
action=OPEN_VIEW_AT
Token |
Description |
buffer.width= |
Specifies the plot width (pixels). |
buffer.height= |
Specifies the plot height (pixels). |
buffer.x= |
Specifies the plot's x co-ordinates (pixels). |
buffer.y= |
Specifies the plot's y co-ordinates (pixels). |
action=PRINT_PLOT_TO
Token |
Description |
buffer.device= |
Specifies the print device. |
buffer.deviceType= |
Specifies the print device type. |
action=SWITCH_VIEW
Token |
Description |
buffer.toPlot= |
Specifies the alias name of plot to switch to. |
NOTES
When using this shell with scripts, delimit the script arguments from
the scrip file using "--" (ie. "script -- arg1 arg2").
FILES
~/.profile
/etc/profile
SEE ALSO
sh(1) UNIX Shell Programming, Stephan G. Kochan, Patrick H. Wood,
Hayden. KornShell: Command and Programming Language (not yet
published), Morris Bolsky and David Korn.
AUTHORS
rtsh was developed by tesserNet Systems Inc. and is based on the
public domain version of ksh (Version 4.9).
DIFFERENCES FROM AT&T VERSION
Csh-style alternations are implemented. Variable arrays are not
implemented. Variable attributes other than integer are not
implemented. The ERR and EXIT traps are not implemented for
functions. Alias expansion is inhibited at the beginning of an alias
definition in the AT&T version. Korn evaluates expressions
differently [elaborate].
BUGS
Interactive shells may occasionally hang while waiting for a job in
the BSD version. The 8th bit is stripped in emacs mode. Quoting
double-quote (") characters inside back-quote (`) inside double-quotes
does not behave properly. Why are you doing this? The emacs mode can
``lose'' stty command done by the user. Unsetting special variables
may cause unexpected results. Functions declared as having local
scope really have global scope. Here documents inside functions do
not work correctly. Exit on error (set -e or set -o errexit) does not
work correctly.