#!/bin/ksh93 # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # 61haes_r720 src/43haes/lib/ksh93/hacmp/KLIB_HACMP_run_command.sh 1.3 # # Licensed Materials - Property of IBM # # COPYRIGHT International Business Machines Corp. 2010 # All Rights Reserved # # US Government Users Restricted Rights - Use, duplication or # disclosure restricted by GSA ADP Schedule Contract with IBM Corp. # # IBM_PROLOG_END_TAG # @(#)05 1.3 src/43haes/lib/ksh93/hacmp/KLIB_HACMP_run_command.sh, hacmp.assist, 61haes_r720, 1542B_hacmp720 9/30/15 12:00:04 #============================================================================ # # Name: KLIB_HACMP_run_command # # Description: Allows arbitrary commands to be run within the clmgr context, # including logging into the clmgr log file. # # Inputs: See the "devDoc()" function, below. # # Outputs: None. # # Returns: Zero if no errors are detected. Otherwise, an appropriate # non-zero value is returned. Refer to the "RETURN" section # of the "devDoc()" function, below, for the standard return # code values/meanings for clmgr. # #============================================================================ function KLIB_HACMP_run_command { LINENO=2 . $HALIBROOT/log_entry "$0()" "$CL" : version=1.3, src/43haes/lib/ksh93/hacmp/KLIB_HACMP_run_command.sh, hacmp.assist, 61haes_r720, 1542B_hacmp720 : INPUTS: $* [[ $CLMGR_LOGGING == 'med' ]] && set +x # Only trace param values typeset -i rc=$RC_UNKNOWN if [[ -n "$@" ]]; then print "$0()[$LINENO]($SECONDS): $@" >>$CLMGR_TMPLOG # Always log commands eval "$@" rc=$? print "$(basename ${1%% *}) RC: $rc" >>$CLMGR_TMPLOG # Always log command result else print -u2 "\nERROR: no command was specified!\n\n" rc=$RC_ERROR fi log_return_msg "$rc" "$0()" "$LINENO" return $? } # End of "KLIB_HACMP_run_command()" #============================================================================ # # Name: devDoc # # Description: This is a never-to-be-called, wrapper function that all the # clmgr FPATH functions implement in order to hide embedded # syntax from trace logging. This information is implemented # in POD format, and can be viewed in a number of ways using # POD tools. Some viewing suggestions for this function's POD- # formatted information are: # # perldoc # pod2text -c # pod2text -c --code # pod2html # # However, the more important use for this information is that # it is parsed by clmgr to display the syntax for this file's # operation. The information in the "SYNOPSIS" section is used # for this purpose. This feature was originally implemented # using the man page information. However, in a code review it # was pointed out that this approach had to be changed because # customers do not have to install the man pages! Therefore, a # built-in dependency on man page information would break the # automatic help feature of clmgr. So the SYNPOSIS section must # be used instead. # # IMPORTANT: As a result of this, it is imperative that the # information in this SYNOPSIS be kept in sync # with the man page information, which is owned # by the IDD team. # # Inputs: None. # # Outputs: None. # # Returns: n/a (not intended to be invoked) # #============================================================================ function devDoc { : <<'=cut' >/dev/null 2>&1 =head1 NAME KLIB_HACMP_run_command =head1 VERSION Version Number: 1.3 Last Extracted: 10/15/15 19:21:01 Last Changed: 9/30/15 12:00:04 Path, Component, Release(, Level): src/43haes/lib/ksh93/hacmp/KLIB_HACMP_run_command.sh, hacmp.assist, 61haes_r720, 1542B_hacmp720 =head1 SYNOPSIS KLIB_HACMP_run_command =head1 DESCRIPTION Runs the specified commands. =head1 ARGUMENTS "$@" The commands and arguments to be run. =head1 RETURN The return code from the last command is returned. =head1 COPYRIGHT COPYRIGHT International Business Machines Corp. 2010,2015 All Rights Reserved =cut } # End of POD-formatted documentation. #============================================================================== # The following, comment block attempts to enforce coding standards when this # file is edited via emacs or vim. This block _must_ appear at the very end # of the file, or the editor will not find it, and it will be ignored. #============================================================================== # Local Variables: # indent-tabs-mode: nil # tab-width: 4 # End: #============================================================================== # vim: tabstop=4 shiftwidth=4 expandtab #==============================================================================