You can invoke all SD-UX commands
non-interactively via the command line. This section provides reference
information about command-line features available across most of the
The command line is most effective for:
Quickly executing simple
Executing tasks that take
a long time to accomplish
Creating commands for
later execution by scripts
A typical command line might look like this:
Figure 1-15 Sample Command
The example shows that you have several ways to
specify SD-UX behavior including command-line
options (such as -f and -s), input files (mysoft and /mnt/cd), and target selections.
A complete list of command line components includes:
Software selections and
software selection files ()
Target selections and
target selection files ()
Each item on this list is discussed in more detail
in the following sections.
Software selections let you specify software in
great detail. You can also use an input file to specify software.
The software_selections syntax is identical for all SD-UX commands that require it (bundle[.product[.subproduct][.fileset]][,version] and product[.subproduct][.fileset][,version]):
The = (equals) relational operator lets you specify selections with the
following shell wildcard and pattern-matching notations:
- [ ]
for multiple characters
for a single character
For example, the following expression installs
all bundles and products with tags that end with man:
swinstall -s sw_server \*man
Bundles and products are
recursive. Bundles can contain other bundles. For example:
or (using expressions):
The version component has the form: [,r <op> revision][,a <op> arch]
[,v <op> vendor][,c <op> category][,q=qualifier][,l=location]
[,fr <op> revision][,fa <op> arch]
Fully qualified software
specifications include the r=, a=, and v= version components, even if they contain
empty strings. For installed software, l= is also
All version components
are repeatable within a single specification (e.g. r>=A.12, r<A.20). If multiple components are used,
the selection must match all components.
The <op> (relational operator) component performs individual comparisons
on dot-separated fields and can be of the form:
=, ==, >=, <=, <, >, or !=
For example, r>=B.11.11 chooses all revisions greater than or equal to B.11.11. The system compares each dot-separated field to find matches.
The = (equals) relational operator lets you specify selections with the
shell wildcard and pattern-matching notations: [ ], *, ?, and ! For example, the expression r=1.* returns
any revision in version 10 or version 11.
No space or tab characters
are allowed in a software selection.
qualifier is a string that can be attached to any product or bundle to help
you filter a software specification.
location applies only to installed software and refers to software installed
to a location other than the default product directory.
fr and fa apply only to filesets.
A software instance_id can take the place of the version component.
It has the form: [instance_id] within the
context of an exported catalog, where instance_id is an integer that
distinguishes versions of products and bundles with the same tag.
To keep the command line
shorter, software selection input files let you specify long lists
of software products. With a software selection file, you only have
to specify the single file name.
The -f command-line option
lets you specify a software selection file. For example:
swinstall -f mysoft -s /mnt/cd @ targetB
example, the file mysoft (which resides
in the current working directory for software files) contains a list
of software selections for the depot /mnt/cd.
In the software file, blank lines and comments
(lines beginning with #) are ignored.
Each software selection must be specified on a separate line.
Target selections follow
software and source depot selections. If no target selection is named,
the target on which the operation will be performed is assumed to
be the root (/) directory on your local host. So,
you do not have to use the @ sign and [host][:][/directory] designation (described below) if you are operating on the local
host or default depot directory.
The target_selections syntax is identical for all SD-UX commands that require it:
The @ character is optional
if you are using the local host and default directory. If it is used,
it acts as a separator between operands and the destination.
Only one @ character is
You can specify the host
by its host name, domain name, or internet address. A directory must
be specified by an absolute path.
The : (colon) is required if you specify both a host and directory.
On some systems, the @
character is used as the kill function. Type stty on your system to see if the @ character is mapped to any other
function on your system. If it is, remove the mapping, change the
mapping, or use \@.
keep the command line shorter, target selection input files let you
specify long lists of targets. With a target selection file, you only
have to specify the single file name.
The -t command-line option
lets you specify a target file. For example:
swinstall -f mysoft -s /mnt/cd -t mytargs
example, the file mytargs (which resides in
the current working directory) contains a list of target selections
for the swinstall command.
In the target file, blank lines and comments (lines
beginning with #) are ignored. Each
target selection must be specified on a separate line and must consist
of a host name or network address, optionally followed by a colon
and a full path:
Using Command Options
You can control many SD-UX
command policies and behaviors by setting the appropriate command
options. You can change the default values of options using predefined
files or values you specify directly on the command-line. Altering
default values with files can help when you don’t want to specify
command behavior every time you invoke the command.
These rules govern the
way the defaults work:
Options in /var/adm/sw/defaults affect all SD-UX commands on that system. This file can change the
default behavior for all commands to which an option applies or for
specific commands only.
Options in your personal $HOME/.swdefaults file affect only you and not the entire
Options read from a session
file affect only that session.
Options changed on the
command line by the -X option_file or the -xoption=value arguments override the system-wide and personal options files but
affect only that invocation of the command.
For system-wide policy setting, use the /var/adm/sw/defaults files. Keep in mind, however, that
users may override these options with their own $HOME/.swdefaults file, session files, or command line changes.
The template file /usr/lib/sw/sys.defaults provides an easy way to change system-wide or personal option files.
The template file lists (as comments):
The commands to which
each option applies
Possible values for each
The resulting system behavior
for each value.
You can copy values from this file into the system
defaults file (/var/adm/sw/defaults), your personal
defaults file ($HOME/.swdefaults), or an input
file (with the -X input_file option) and edit them to affect SD-UX behavior.
Option files use this syntax:
The optional command is the name of a SD-UX command. Specifying
a command name changes the default behavior for that command only.
A period must follow a command name.
option is the name of the default option. An equals sign must follow the
value is one of the allowable values for that option.
To change the default
value of use_alternate_source to
true for all users for all future sessions for all commands to which
the option applies, place the following line in the /var/adm/sw/defaults file:
To change the default value of use_alternate_source to false for your own invocations
of the command, place the following line in your $HOME/.swdefaults file:
To start an interactive swinstall session using the options stored in my_install_defaults to override any system-wide or personal defaults file values:
swinstall -i -X my_install_defaults=true
To start an interactive install session and reset
the use_alternate_source default
for this session only:
swinstall -i -x use_alternate_source
See Appendix A for a complete listing of defaults and their values and descriptions.
|CAUTION: Changing the default values for command options
can cause harmful results if you specify inappropriate values.|
Before any SD-UX task starts, the system automatically
saves the current command options, source information, software selections,
target selections, etc., into a session file. You can then re-use this session information at a later time, even
if the command fails.
Session information is saved in the $HOME/.sw/sessions/ directory as command.last in which command is the name of the command. Each time you save a session file, it
overwrites the previously stored one. (To save multiple session files,
you can rename each session file after you invoke the command.)
To re-use the automatically saved session file,
invoke the command with the -S swcommand.last argument. For example:
swinstall -S swinstall.last
If you want to save a session file to somewhere
other than the default sessions directory, use the -C session_file argument and supply your
own absolute path to the file you wish to save. If you do not specify
a directory, the default location for the session file is $HOME/.sw/sessions/.
To re-execute a session from a command line, specify
the session file as the argument for the -S session_file option.
Note that when you re-execute a session file,
the session file values take precedence over values in the system
defaults file or personal defaults file. Likewise, any command line
options or parameters that you specify when you invoke the command
take precedence over the values in the session file.
Here is a sample a session file. It uses
the same syntax as the defaults files:
# swinstall session file
# Filename /users/fred/.sw/sessions/swinstall.last
# Date saved 05/26/01 15:59:41 MDT
swinstall.allow_downdate = true
swinstall.allow_incompatible = false
swinstall.allow_multiple_versions = false
swinstall.autoreboot = false
swinstall.autorecover_product = false
swinstall.compress_files = false
swinstall.create_target_path = true
(A typical swinstall session
file has approximately 70 lines.)