Current Supported Releases: Sablime® v6.0 & v5.2
NAME
sbcsenv - locate and display the SBCS environment files.
SYNOPSIS
sbcsenv [-adfnpu]
DESCRIPTION
sbcsenv is used to locate and display the files controlling
the SBCS environment. There can be at most two such files:
a project file, used only with multi-user projects, and a
user file, to hold private user definitions.
Before scanning their arguments, SBCS commands look for the
shell environment variable SBCSPROJ to locate the project
file, then for SBCSENV to locate the user file. If SBCSENV
is not found, commands look for a default file named
.sbcsenv. Information from these files can be used to
resolve command line s-file arguments.
SBCSPROJ
If this variable is set and not null, it must point to
a readable file. That file should contain sbcsenv vari-
ables definitions applicable to all members of a pro-
ject. The sbcsproj(1) interface program can be used to
export SBCSPROJ and ensure a common definition.
SBCSENV
If this variable is not defined, commands automatically
search for a file named .sbcsenv in the current direc-
tory and in directories along the current directory
path, up to, but not including, / (root). The search
stops at the first .sbcsenv file found.
If SBCSENV is defined but its value is null, no search
is done.
If SBCSENV is defined and not null, its value must be a
valid path to a readable file.
Neither of these two sbcsenv files need be defined, or they
may be empty.
OPTIONS
-a Print the actual values of all sbcsenv variables.
-d Print the default value of all the sbcsenv variables.
These are the system defaults, not affected by project
or user redefinitions.
-f Print the path to an sbcsenv file. If -p was speci-
fied, the project file path is printed, otherwise the
SunOS 5.6 Last change: 1 April 1994 1
user file path is printed. sbcsenv uses the same
method any other SBCS command would use to locate the
file.
-p Give only the project file or values.
-u Give only the user file or values.
-n Print only new variables and values, i.e. those vari-
ables that have been redefined to non-default values.
sbcsenv prints either location (-f) or content (-a, -d, -n),
so these two option sets are not compatible.
SBCSENV VARIABLES
A complete listing of sbcsenv variable names and their
default values can be obtained, grouped by category, with
sbcsenv -d
The variable values are either boolean, integer or character
string. Boolean variables have the values yes or no while
strings must be double quoted. sbcsenv files should follow
a format similar to sbcsenv -d output. Comments (leading #)
and blank lines are allowed, as is an optional = sign
between name and value (see EXAMPLE below). The following
is a list of the the variables in alphabetical order with
their default value in brackets.
allow_branch [= yes]
The nget command will automatically branch if a version
that is not the latest one on the trunk or a branch is
gotten for edit, even if a branch version was not
requested. Setting allow_branch = no prevents any new
branches from being created; instead, nget will fail.
allow_interactive [= yes]
The nadmin and ncdc commands allow some options to
cause parts of the s-file to be interactively edited.
Usually by using the tilde sequence ~e as an option
value. Interactive editing can cause the s-file to be
locked for excessive periods of time and in some cases
this can lead other commands to mistakingly conclude
that the s-file lock is obsolete. Setting
allow_interactive = no effectively prevents the use of
~e option values.
answer_yes [= no]
SBCS commands issue yes/no prompts on two occasions:
when a backup file is encountered and when a directory
needs to be created. If a backup file is encountered,
commands prompt whether the s-file should be restored
or not. If the answer is y, restoration is attempted
SunOS 5.6 Last change: 1 April 1994 2
but may fail if, e.g., the user does not have the right
permissions to do so. If restoration fails processing
moves on to the next s-file, if any. Specifying
answer_yes = yes will preempt these prompts by automat-
ically providing a yes answer. A command may still
fail, but it won't block, waiting for an answer.
auto_prefix [= no]
A command line consists of option arguments followed by
s-file arguments. Normally, when an s-file argument
refers to an actual s-file, it must be the name of the
s-file, including its s. prefix. Specifying
auto_prefix = yes allows the prefix to be omitted; the
command then adds the prefix itself.
delta_edit [= no]
Setting delta_edit = yes automatically sets the -E
options on all uses of ndelta. Every time a version is
returned to the s-file, a new version is reserved and
an editable g-file is left behind.
delta_get [= no]
Setting delta_get = yes automatically sets the -G
options on all uses of ndelta. Every time a version is
returned to the s-file, a view-only g-file is left
behind.
editor [= "vi"]
The default editor is the env variable VISUAL or EDI-
TOR. If neither of these is defined the value of edi-
tor is used. The editor is called by options that
allow the ~e tilde sequence (see nadmin(1) and
ncdc(1)).
error_label [= "ERROR [:-:]: "]
Error messages are always issued to stderr, but the
error prefix can be customized. The string provided is
scanned for three special tokens: :-: (default file
name), :F: (base file name) and :PN: (full path name).
The tokens look like DATA keywords (see nprs(1)) but
:-: is new.
force_delta [= yes]
Normally a successful call to ndelta always creates a
new delta. With force_delta = no, a new delta is
created only if the new version differs from it's
predecessor or if the new version has been given a
name.
highlight [= 3]
Some commands (nhelp, sidtree, ...) highlight selected
parts of the screen display by printing characters with
SunOS 5.6 Last change: 1 April 1994 3
underscores (highlight = 2) or overstriking (highlight
= 3). If this variable is set to 0 or 1, no highlight
is ever produced. If stdout is not a terminal,
highlighting is suppressed unless specifically
requested. By itself a terminal does not show the
effects of highlighting. The paging program (specified
by either the env variable PAGER or the sbcsenv vari-
able pager) is responsible for converting the under-
scores and overstrikes to screen attributes or colors.
The less(1) pager provides better highlights than
either more(1) or pg(1).
host_only_lock [= yes]
If file_control_lock = no, commands look at
host_only_lock to determine the locking scheme. If
host_only_lock = yes the traditional SCCS and SBCS 1.0
scheme is used (but can fail when remote processes
share the host's file system, as in a networked
environment). If host_only_lock = no a safer method is
used that relies on the z-file time stamp. A z-file
that is less than time_zfile_valid seconds old is
assumed to be valid.
lock_timeout [= 10]
When a command is blocked from accessing an s-file or
p-file because of an edit or read lock, it waits for
lock_timeout seconds, polling the lock every second,
before giving up and declaring an error.
mrs_comment_mode [= 0]
When MRs and comments are entered in response to the
ndelta prompts MRs? and comments?, the default mode is
to interpret the first unescaped carriage return as the
end of input. With mrs_comment_mode = 1, end of input
is signaled with a single . (period) on a new line;
carriage returns start new lines.
pager [= "cat"]
The paging program is taken from the env variable
PAGER. If this variable is not set, the sbcsenv vari-
able pager is used.
recursive [= no]
Commands that take s-file arguments also accept direc-
tories. To recursively search directories for s-files,
the option -R can be used. If this is to be the default
mode, setting recursive = yes will always implies -R.
separator [= "\n"]
When processing multiple s-files, each s-file is iden-
tified by sfile_label and also separated from the next
one by separator.
SunOS 5.6 Last change: 1 April 1994 4
file_control_lock [= no]
If file_control_lock = yes, UNIX fcntl(2) locks are
used to prevent simultaneous updating of the s-file.
In this case the complete set of edit-edit, edit-read
and read-edit locks are implemented; the setting of
host_only_locks is ignored. If file_control_lock = no,
host_only_lock determines the locking scheme.
sfile_label [= ":-::\n"]
When processing multiple s-files, each s-file is iden-
tified by sfile_label and also separated from the next
one by separator.
silent_mode [= no]
Most commands recognize the -s option as the silent
option, i.e., they don't display nonessential informa-
tion. With silent = yes the silent option is always
implied.
source_tree [= ""]
A source tree is a convenient way to organize the s-
files in a parallel directory tree that commands know
how to search. In a multi-user project, the source
tree is owned an maintained by the SBCS administrator.
The top of the source tree is the s-node and it matches
a directory in each user's work space called the g-
node. For each user, a g-node:s-node pair defines a
source tree.
If a source tree is defined, all s-files are expected
to be under the s-node, and all g-files under the g-
node. Moreover, an s-file must then be referred to by
using the name of the corresponding g-file. Commands
automatically provide the s. prefix and map the name to
the corresponding directory under the s-node. (See
EXAMPLE below).
strict_branch [= no]
The -b option of nget is normally used to create a
branch from a leaf version: i.e. the last version of
the trunk or of a branch. This means branches can be
created without -b and using -b doesn't guarantee a
branch (the s-file b flag has to be set too).
If strict_branch = yes, nget will not create a branch
unless -b is specified; and if -b is specified, it will
create a branch. If constraints prevent the strict
interpretation of -b (as when the s-file b flag is not
set), nget will fail.
strict_delta [= yes]
Normally a call to ndelta is strict: it results either
SunOS 5.6 Last change: 1 April 1994 5
in a successful delta or an error message, for each s-
file matched by s-file arguments. If strict_delta = no
no error message is issued if (1) there is no p-file
and no writable g-file, or (2) the user is not in the
p-file and there is no writable g-file. The return code
is also not set.
strict_get [= yes]
Normally a call to nget is strict: it generates a valid
g-file or an error statement, for each s-file matched
by s-file arguments. If strict_get = no, no error mes-
sage is issued if a writable g-file already exists;
nget simply moves on to the next s-file. The return
code is also not set.
time_zfile_valid [= 3600]
If file_control_lock = no and host_only_lock = no, then
time_zfile_valid determines the locking scheme. Other-
wise it is ignored. A command that finds a z-file lock
simply looks at its age to determine if the lock is
valid. If the z-file is more than time_zfile_valid
seconds old, it is removed and the command proceeds as
if the s-file were unlocked.
On small systems with large s-files, it is conceivable
that an s-file update may take longer than
time_zfile_valid, especially if this number has been
revised down from its default value.
time_zfile_valid should not be too low, or clock
differences between machines on the same network will
render it meaningless.
tmpdir [= "/tmp"]
The directory for temporary files is taken from the env
variables TMPDIR, TEMP or TMP. If none of these is
defined and non-null, the sbcsenv variable tmpdir is
used.
use_delta_mode [= no]
The s-file stores the original version modes. If
use_delta_mode = yes the original read and execute
modes are restored when the file is gotten. The write
modes are determined by whether the s-file was gotten
for viewing or editing.
use_delta_time [= no]
The s-file stores the original version time. If
use_delta_time = yes the original modification time is
restored when the file is gotten; the access time will
be the current time.
SunOS 5.6 Last change: 1 April 1994 6
warning_label [= ""]
Warning messages are issued on stderr but use no spe-
cial prefix. Another possibility is warning_label =
"WARNING [:F:]: ".
EXAMPLE
The following is an example of an sbcsenv user file.
$ cat $HOME/.sbcsenv
auto_prefix = yes
source_tree = "$HOME:$HOME/.SBCS"
force_delta = no
use_delta_mode = yes
use_delta_time = yes
input_style = 1
error_label "ERROR [:F:]: "
warning_label "WARNING [:F:]: "
sfile_label ":F::\n"
pager = "less"
Because source_tree is defined, the definition of
auto_prefix is not necessary. Notice that all s-file labels
have been changed to their minimal form :F:, probably
because the source tree is a complete mirror of all this
user's files, and complete s-file names could become very
long. Using an explicit warning_label helps distinguish
warnings from mere messages (warnings are also sent to stan-
dard error).
It is usually best to anchor the source tree by using abso-
lute path names for the top node directories. Not doing so
is allowed (e.g. the trivial case source_tree = ".:.", but
usually leads to inconsistencies when SBCS commands are used
to operate on files that are not in the current directory.
Continuing with the initial example,
$ cd $HOME/build/src
$ nadmin -i. .
will use all regular files from . to initialize s-files in
the $HOME/.SBCS/build/src directory. The s-files will have
names derived from the local files by adding the s. prefix.
If any intermediate directory does not exist, nadmin issues
a prompt (create directory now (y,n)?) and attempts to
create it, if so instructed. Issuing the same command twice
is safe because nadmin will not overwrite an existing s-
file. The command
$ nadmin -R -i. .
Would have recursively installed the same files from . but
also the files from all . subdirectories, creating
corresponding subdirectories under the source tree s-node.
When potentially many files are to be installed it is always
prudent to take an advance look at what will happen with
commands such as
SunOS 5.6 Last change: 1 April 1994 7
$ psd
$ nadmin -NRi . .
Files can be retrieved for edit with similar commands
$ nget -e .
or recursively, prompting and creating g-node subdirectories
as needed,
$ nget -eR .
Because the sbcsenv use_delta_time and use_delta_mode are
set, the g-files will have modification time and read-
execute modes of the original versions. A single file could
have been retrieved by giving only the expected g-file name.
For example,
$ nget -e ftd_data.c
Using information from source_tree and not finding subdirec-
tories (that would be named ftd_data.c!) under the g-node
and s-node, nget deduces that ftd_data.c represents an s-
file (in `psd`); it adds the s. prefix and the s-node offset
to retrieve the file.
After being edited files can be returned with
$ ndelta [-R] -E -y- .
Because the sbcsenv force_delta is unset, the files that
were not changed will not create new deltas and because the
-E option was used, a new SID is reserved for all files. For
those that were not changed, this will be the same SID.
Individual files could have been returned by simply giving
the corresponding g-file name.
$ ndelta -E -y- ftd_data.c
These few examples show how the SBCS environment, and a
source tree in particular, can help organize the s-file
database rationally, and reduce the length of file paths
that have to be typed, even as the files themselves may have
been moved to some more distant directory tree.
NOTES
Multi-User
When using the sbcsproj interface, the command should
be used as
sbcsproj sbcsenv [-adfnpu]
to pick up the SBCSPROJ definition from sbcsproj. The
combination sbcsproj sbcsenv may have been aliased to
something more convenient, or a sbcsenv may have been
redefined for the project
SEE ALSO
, nadmin(1), ndelta(1), nget(1), nhelp(1), nprs(1),
psd(1), sfile(1).
SunOS 5.6 Last change: 1 April 1994 8
Return to SBCS Commands manpage index
Copyright © 2003
Lucent Technologies