#!/bin/ksh # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # bos720 src/bos/usr/lib/nim/methods/c_lswpar.sh 1.3 # # Licensed Materials - Property of IBM # # COPYRIGHT International Business Machines Corp. 2008 # 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 # @(#)09 1.3 src/bos/usr/lib/nim/methods/c_lswpar.sh, cmdnim, bos720 7/15/08 13:34:34 # # COMPONENT_NAME: CMDNIM # # FUNCTIONS: ./usr/lib/nim/methods/c_lswpar.sh # # ORIGINS: 27 # # # (C) COPYRIGHT International Business Machines Corp. 1996 # All Rights Reserved # Licensed Materials - Property of IBM # US Government Users Restricted Rights - Use, duplication or # disclosure restricted by GSA ADP Schedule Contract with IBM Corp. # # include common NIM shell defines/functions NIMPATH=${0%/*} NIMPATH=${NIMPATH%/*} [[ ${NIMPATH} = ${0} ]] && NIMPATH=/usr/lpp/bos.sysmgt/nim NIM_METHODS="${NIMPATH}/methods" . ${NIM_METHODS}/c_sh_lib #---------------------------- module globals -------------------------------- REQUIRED_ATTRS="" OPTIONAL_ATTRS="cmd_flags" #---------------------------- c_lswpar -------------------------------- # # NAME: c_lswpar # # FUNCTION: # Prints out lswpar information # # EXECUTION ENVIRONMENT: # # # RECOVERY OPERATION: # # DATA STRUCTURES: # parameters: # global: # # RETURNS: (int) # # OUTPUT: #------------------------------------------------------------------------------- # signal processing trap cleanup 0 trap err_signal 1 2 11 15 # NIM initialization nim_init typeset -i query_only=0 # set parameters from command line while getopts :a:qQv c do case ${c} in a) # validate the attr ass parse_attr_ass "${OPTARG}" # include the assignment for use in this environment eval ${variable}=\"${value}\" ;; q) # show attr info cmd_what exit 0 ;; Q) # just return exit code from query query_only=1 ;; v) # verbose mode (for debugging) verbose=TRUE set -x for i in $(typeset +f) do typeset -ft $i done ;; \?) # unknown option error ${ERR_BAD_OPT} ${OPTARG} ;; esac done # check for missing attrs ck_attrs shift $((OPTIND - 1)) # run lswpar if [[ $query_only -eq 1 ]] then ${LSWPAR} ${cmd_flags} $@ >/dev/null 2>&1 exit $? else ${LSWPAR} ${cmd_flags} $@ 2>${ERR} fi # Save the return code from the command. cmd_rc=$? if [[ ${cmd_rc} -ne 0 ]] then err_from_cmd ${LSWPAR} fi # all done exit ${cmd_rc}