2.3.9. - Starting Up
When you run spec, you invoke it using a name such as
fourc,
twoc,
surf,
spec,
etc.
That name
determines the kind of geometry code that will be available and
which macro and configuration files in the auxiliary file directory
will be used, as explained below.
The following command line options are recognized by spec:
- -f
- Fresh start.
All symbols are set to their default values and
the standard macros are read to establish the default state.
- -F
- Clean and fresh start.
All symbols are set to their default values but
no command files are read and no macros are defined.
Only the built-in commands are available.
- -s
- Simulation mode.
No hardware commands are issued.
Simulation mode cannot be turned off after entering the program.
- -y
- Yes, change motor controller registers
initially if they disagree with the
settings
file.
Normally, spec requires you to
confirm such a change.
This flag would be useful if you know
controller power had been turned off, and the controller's current positions
should be updated with the software positions.
- -o option=value
- Initializes the
spec_par()
option
to
value.
Type
spec_par("?") from the spec prompt to see the available options.
- -p fd pid
- Indicates that spec input is coming from a pipe from another program.
The argument
fd
is the file descriptor that spec should use for standard input.
The argument
pid
is the process ID of the spawning process.
If
fd
is zero,
spec will not re-echo input from the file descriptor to spec's
standard output.
- -q
- Indicates that spec should operate in quiet mode and allow output to
all devices to be turned off.
This option is only valid when used with the -p option.
- -g geometry
- Force loading of macro files and activation of geometry calculations
for the specified geometry,
while using the configuration files taken from the name by which spec is
invoked.
- -N my_name
- Use
my_name
instead of the name by which spec
was invoked to establish the command prompt
and the name of the directory in
SPECD
in which the configuration-dependent files exisit.
This command also sets the geometry to my_name.
Follow this option with the
-g option to choose a different name for the geometry.
- -u user
- Use
user's
last saved state as the current user's initial state.
- -t tty
- Use the current user (or
user's)
last saved state from the terminal specified by
tty as the initial state.
The terminal can be specified as
-t /dev/tty01 or
-t tty01. Pseudo-tty names, such as
/dev/ttyp0,
/dev/ttyp1,
etc., are saved as
/dev/ttyp#,
since there is no special significance to the number.
- -T fake_tty
- This option creates a user state associated with
fake_tty,
which may be any name.
This option allows you to bypass the locking feature that prevents multiple
instances of spec to be started by the same user from the same terminal.
- -d debug
- Sets the initial value of the debugging variable
DEBUG to
debug, which maybe either in decimal or hexadecimal
(with a leading 0x) format.
The available debugging categories are described
2.3.13.1
.
- -D direc
- Use
direc
as the auxiliary file directory,
instead of the
compiled-in name (usually
/usr/local/lib/spec.d)
or the value of the
SPECD
environment variable.
In some installations,
spec is installed as a set-user-id root process, to allow
certain calls that allow privileged access to hardware device registers.
The first thing spec does on start up is to
set the effective user and group
ids to that of the real user, so there is no danger of the user
spawning subshells or creating files as root.
The root effective id is only used for the duration of
the calls that enable the privileged access.
spec then performs other initialization tasks, including obtaining values
for its internal variables
DISPLAY, GTERM, TERM, HOME and
PAGER from variables of the same name in the process environment.
It also obtains the value of the
SHELL environment variable for use with the
unix()
function.
spec then reads the hardware configuration from
the appropriate
config
file from the auxiliary file directory.
The path name of that file is
SPECD/spec/config,
where
SPECD
is the auxiliary file directory, established when
spec is installed (or by the
-D invocation flag, or by the
SPECD
environment variable), and
spec
is the name by which spec is invoked.
The first time a user starts spec,
up to seven
macro files are automatically read.
The path names of these files are
SPECD/standard.mac
SPECD/geom.mac
SPECD/spec/geom.mac
SPECD/site_f.mac
SPECD/site.mac
SPECD/spec/conf.mac
./spec.mac
where
SPECD
is the auxiliary file directory, as described above,
geom
matches the first four letters of the name by which spec was invoked
and
spec
is the complete name by which spec was invoked.
The files are only read if they exist.
The files
SPECD/standard.mac,
SPECD/geom.mac,
SPECD/spec/geom.mac
and
SPECD/site_f.mac
are only read if the user is starting spec for the first time or has
invoked spec with the
-f (fresh start) flag.
Each time spec starts up, if a macro named
begin_mac is defined, that macro will be run after reading any startup command files,
but before input is read from the keyboard.
After reading the start-up macro or command files and possibly running
begin_mac, spec prompts the user for commands.
|