DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

ccsSetup(CDMT)


ccsSetup -- standard shell functions library

Syntax

. ccsSetup.sh

Description

The ccsSetup standard shell library defines common functions and environment variables to use in CDMT Bourne and Korn shell scripts.

ccsSetup defines the following functions:


ccsLog
Log the given message to a log file.

Usage:
ccsLog [-p prefix] [-l logfile] [-o output] "message"

Options:
prefix is a string that is prepended to the message.

logfile is the name of the logfile to use. If logfile is not specified, ccsLog writes the message to the log specified by the $LOGFILE variable.

output is either of the strings ``stderr'' or ``stdout''. This message is logged and echoed to the given location.

message is the message to be logged.


Returns:
$OK

Notes:
Because the -o option causes output to the screen, do not use it directly in ccs script. Use the ccsError function instead.

Example:
ccsLog "$MSG1"

ccsDebug
Log the given message to a log file if custom(ADM) is run in debug mode.

Usage:
ccsDebug [-p prefix] [-l logfile] [-o output] "message"

Options:
prefix is a string that is prepended to the message.

logfile is the name of the logfile to use. If logfile is not specified, ccsDebug writes the message to the log specified by the $LOGFILE variable.

output is either of the strings ``stderr'' or ``stdout''. This message is logged and echoed to the given location.

message is the message to be logged.


Returns:
$OK

Notes:
Because the -o option causes output to the screen, do not use it directly in ccs script. Use the ccsError function instead.

Example:
ccsDebug "$MSG1"

ccsError
Log the given error message to a log file and display the error on stderr. Use this function to indicate a fatal error in a ccs script.

Usage:
ccsError [-p prefix] [-l logfile] "message"

Options:
prefix is a string that is prepended to the message.

logfile is the name of the logfile to use. If logfile is not specified, ccsError writes the message to the log specified by the $LOGFILE variable.

message is the error message.


Returns:
$OK

Example:
ccsError "$ERRMSG1"

ccsWarning
Log the given warning message to a log file. Use this function to indicate a non-fatal error in a ccs script.

Usage:
ccsWarning [-p prefix] [-l logfile] "message"

Options:
prefix is a string that is prepended to the message.

logfile is the name of the logfile to use. If logfile is not specified, ccsWarning writes the message to the log specified by the $LOGFILE variable.

message is the warning message.


Returns:
$OK

Example:
ccsWarning "$WARNMSG1"

ex_cmd
Execute the given command and optionally save stderr and stdout to $LOGFILE.

Usage:
ex_cmd [-l logfile] [-m mode] [-d] command

Options:
logfile is the name of the logfile to use. If logfile is not specified, ex_cmd writes the message to the log specified by the $LOGFILE variable.

mode is either "ERR_NULL" to redirect stderr and stdout to /dev/null or "STANDARD" to redirect stderr and stdout to logfile; "STANDARD" is the default.

-d sets debug mode. The command to execute is echoed to logfile prior to execution. Another way to set debug mode is to set the DEBUG_EX_CMD variable to ``yes''.

command is the command to execute.


Returns:
The exit value of command.

getPackageCode
Returns the short form of the package name. For example, getPackageCode converts ``SCO:ipxrt:IPXRT'' to ``IPXRT''.

Usage:
getPackageCode pkgName [pkgName ...]

Options:
pkgName is the fully-qualified package name, "vendorCode:componentCode:packageCode"; This function echoes packageCode to stdout. If pkgName is not of this form, getPackageCode echoes nothing.

Returns:
$OK

Notes:
The result string is echoed to the function's stdout.

Example:
short_name_list='getPackageCode $long_name_list'

Variables

The ccsSetup library defines the following variables:

TMPDIR
Available for temporary storage which does not need to persist across invocations of the ccs script. Place all intermediate or temporary files created by the ccs script in the $TMPDIR directory. To eliminate namespace collisions, each component should create a uniquely-named subdirectory in $TMPDIR. For example, the X server component would use $TMPDIR/xsrvr.

LOGFILE
system-wide installation logfile. Use routines in the ccsSetup library to contribute to the log.

Exit values

The ccsSetup library defines the following exit codes for ccs scripts:

OK
The script executed successfully. Always set to 0.

FAIL
The script did not execute successfully and the installation or removal should be terminated. Always set to 1. See ccs(CDMT) for more information.

WARN
Some warnings were logged, but the installation or removal should continue. Always set to 2.

STOP
Stop processing on this component, but continue the task without user intervention.

Files

/ibin/ccsSetup.sh
/lib/std_funcs

See also

ccs(CDMT), cqs(CDMT), custom(ADM)

UNRESOLVED XREF-0 and
UNRESOLVED XREF-0

Standards conformance

ccsSetup is not part of any currently supported standard; it is an extension of AT&T System V provided by The Santa Cruz Operation, Inc.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 26 May 2005