getcompfiles.sh

来自「CMVC是IBM和许多跨国公司的缺陷管理工具。这里给出了很多在Linux下用KS」· Shell 代码 · 共 110 行

SH
110
字号
#!/bin/ksh## SAMPLE NAME: getCompFiles## FUNCTIONS:   This sample shell script gets all the files associated with a#              specific component.  The files are placed in a directory that#              represents the release name to which the version of the file#              is associated.  This directory is created relative to the#              relativePathName parameter.  The most recently created version#              of the file will be extracted by default unless the committed#              parameter is provided in which case only the committed versions#              will be extracted.## USAGE:       getCompFiles componentName relativePathName [committed]## ENVIRONMENT# VARIABLE(S): CMVC_FAMILY [CMVC_BECOME]## 5765-207 (C) COPYRIGHT International Business Machines Corp. 1993,1994# 5765-202 (C) COPYRIGHT International Business Machines Corp. 1993,1994# 5622-063 (C) COPYRIGHT International Business Machines Corp. 1993,1994# 5765-397 (C) COPYRIGHT International Business Machines Corp. 1994# 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.###           NOTICE TO USERS OF THE SOURCE CODE EXAMPLES## INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THE SOURCE CODE# EXAMPLES, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS, "AS IS" WITHOUT# WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT# LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A# PARTICULAR PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE# OF THE SOURCE CODE EXAMPLES, BOTH INDIVIDUALLY AND AS ONE OR MORE GROUPS,# IS WITH YOU.  SHOULD ANY PART OF THE SOURCE CODE EXAMPLES PROVE# DEFECTIVE, YOU (AND NOT IBM OR AN AUTHORIZED RISC System/6000* WORKSTATION# DEALER) ASSUME THE ENTIRE COST OF ALL NECESSARY SERVICING, REPAIR OR# CORRECTION.## * RISC System/6000 is a trademark of International Business Machines#   Corporation.## /usr/lpp/cmvc/samples/getCompFiles#if [ $# -eq 0 ]; then        echo "\nusage: $0 componentName relativePathName [committed]\n"        echo "This sample shell script extracts all the files associated with"        echo "a specific component.  The files are placed in a directory that"        echo "represents the release name to which the version of the file"        echo "is associated.  This directory is created relative to the"        echo "relativePathName parameter.  The most recently created version"        echo "of the file will be extracted by default unless the committed"        echo "parameter is provided in which case the committed versions of"        echo "the files will be extracted.\n"    exit 1fiif [ -z "$CMVC_FAMILY" ]then  echo "The CMVC family must be set with the CMVC_FAMILY environment variable."  exit 1fi#relative=$2echo ""echo "Multiple copies of a file may exist within a component with each"echo "version of the file being owned by a separate release.\n"echo "As a result, a directory will be created for each release and the"echo "files will be copied into their respective directories relative to"echo "the relativePathName parameter that you have supplied.\n"if [[ -n "$3" ]]then  # -------------------------------------------------------------------------  # user wants the committed versions of the files, use the version parameter  # -------------------------------------------------------------------------  Report -view fileview -wh "compName='$1'" -raw > /tmp/gf$$  while read line  do     fname=`echo $line | cut -d'|' -f1 `     release=`echo $line | cut -d'|' -f2 `     version=`echo $line | cut -d'|' -f4`     echo "Copying version $version of $fname to $relative/$release"     File -ext $fname -relative $relative/$release -release $release -vers $version  done </tmp/gf$$else  # ------------------------------------------------------------------------  # user wants the newest versions of the files, use the nuversion parameter  # ------------------------------------------------------------------------  Report -view fileview -wh "compName='$1' and dropDate is null" \         -raw > /tmp/gf$$  while read line  do     release=`echo $line | cut -d'|' -f2 `     name=`echo $line | cut -d'|' -f8`     nuversion=`echo $line | cut -d'|' -f9`     echo "Copying version $nuversion of $name to $relative/$release"     File -ext $name -relative $relative/$release -release $release -vers $nuversion  done </tmp/gf$$fi# end of file

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?