Software Distributor Administration Guide for HP-UX 11i
Using Control Scripts
Using Environment Variables
Chapter 11 383
Here is an example of sourcing:
. ${SW_CONTROL_DIRECTORY}subscript
grep something ${SW_CONTROL_DIRECTORY}datafile
SW_CONTROL_TAG
• Holds the tag name of the control_file being executed. When
packaging software, you can define a physical name and path for a
control file in a depot. This lets you define the control_file with a
name other than its tag and lets you use multiple control_file
definitions to point to the same file. A control_file can query the
SW_CONTROL_TAG variable to determine which tag is being executed.
SW_LOCATION
• Defines the location of the product, which may have been changed
from the default product directory (if the product is locatable).
When installing to (or removing from) the primary root directory
(“/”), this variable is the absolute path to the product directory. For
operations on an alternate root directory, the variable must be
prefixed by SW_ROOT_DIRECTORY to correctly reference product
files.
If a product is not locatable, then the value of SW_LOCATION will
always be the default product directory defined when the product is
packaged.
SW_PATH
• The search path for commands. A PATH variable defines the
minimum set of commands available for use in a control script (for
example, /sbin:/usr/bin:/usr/ccs/sbin).
A control script should always set its own PATH variable, and the
PATH variable must begin with $SW.PATH. The PATH should be set
as follows:
PATH=$SW_PATH
export PATH
Additional directories, like /usr/local/bin, can be appended to
PATH, but you must make sure that the commands in those
directories exist.