⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 defectreport

📁 CMVC是IBM和许多跨国公司的缺陷管理工具。这里给出了很多在Linux下用KSH编写的使用CMVC命令的例子。这些例子来自于IBM内部的CMVC培训。
💻
字号:
#!/bin/ksh## SAMPLE NAME: defectReport## FUNCTIONS:   This sample shell script generates a global defect report#              showing tracks, tests, approvals and fixes.##              The report contains 132 columns of data and should be piped#              to an output file for subsequent printing.## USAGE:       defectReport## ENVIRONMENT# VARIABLE(S): CMVC_FAMILY [CMVC_BECOME]## ORIGINS:     27## 5765-039 (C) COPYRIGHT International Business Machines Corp. 1991,1993# 5765-207 (C) COPYRIGHT International Business Machines Corp. 1993# 5765-202 (C) COPYRIGHT International Business Machines Corp. 1993# 5622-063 (C) COPYRIGHT International Business Machines Corp. 1993# 5765-069 (C) COPYRIGHT International Business Machines Corp. 1991,1993# 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/defectReport#if [ -z "$CMVC_FAMILY" ]then  echo "The CMVC family must be set with the CMVC_FAMILY environment variable."  exit 1fi## Clean up on interrupt#trap "[ -r /tmp/tra$$ ] && rm -f /tmp/tra$$[ -r /tmp/trx$$ ] && rm -f /tmp/trx$$[ -r /tmp/tst$$ ] && rm -f /tmp/tst$$[ -r /tmp/rpt$$ ] && rm -f /tmp/rpt$$[ -r /tmp/fix$$ ] && rm -f /tmp/fix$$[ -r /tmp/apr$$ ] && rm -f /tmp/apr$$exit" 1 2 3 15##echo "Detailed Defect Report \n"#echo "\npre name            compName        state    origin   owner    sev age abstract"echo   "--- --------------- --------------- -------- -------- -------- --- --- -------------------------------------------------------------"##Report -vi DefectView -w "state not in ('closed','canceled')" -ra |\sort -t'|' -o /tmp/rpt$$ +1 -2 -nwhile read linedo        echo $line | awk -F'|' '{printf\        "%3.3s %-15.15s %-15.15s %-8.8s %-8.8s %-8.8s %-3.3s %-3.3s %-61.61s\n",\        $1,$2,$3,$6,$22,$5,$8,$10,$9}'        STATE=`echo $line | cut -f6 -d'|' `        if [ $STATE = 'working' ]        then                NUM=`echo $line | cut -f2 -d'|' `                Report -vi TrackView -w "defectName='$NUM' and \                state<>'complete'" -ra > /tmp/tra$$                while read trackline                do                        RELEASE=`echo $trackline | cut -f1 -d'|' `                        TRACKSTATE=`echo $trackline | cut -f4 -d'|' `                        echo "\n\t\t< Track: state =" $TRACKSTATE " release =" $RELEASE " >\n" > /tmp/trx$$                        Report -vi ApprovalView -w "defectName='$NUM' and \                        releaseName='$RELEASE'" -ra | awk -F'|' '{printf \                        "\t\t\t< %8.8s: state = %-9.9s %11.11s = %-15.15s %7.7s = %-15.15s >\n","Approval",$7,"release",$3,"owner",$4                        }' > /tmp/apr$$                        Report -vi TestView -w "defectName='$NUM' and releaseName='$RELEASE' and \                        state not in ('notReady')" -ra | awk -F'|' '{printf \                        "\t\t\t< %8.8s: state = %-9.9s %11.11s = %-15.15s %7.7s = %-15.15s >\n","Test",$5,"environment",$4,"owner",$8                        }' >/tmp/tst$$                        Report -vi FixView -w "defectName='$NUM' and releaseName='$RELEASE' and \                        state not in ('notReady')" -ra | awk -F'|' '{printf \                        "\t\t\t< %8.8s: state = %-9.9s %11.11s = %-15.15s %7.7s = %-15.15s >\n","Fix",$4,"component",$3,"release",$2                        }' >/tmp/fix$$                        [ -s /tmp/tra$$ ] && cat /tmp/trx$$                        [ -s /tmp/apr$$ ] && cat /tmp/apr$$                        [ -s /tmp/fix$$ ] && cat /tmp/fix$$                        [ -s /tmp/tst$$ ] && cat /tmp/tst$$                        echo "\n"                done < /tmp/tra$$                [ -r /tmp/tra$$ ] && rm -f /tmp/tra$$                [ -r /tmp/trx$$ ] && rm -f /tmp/trx$$                [ -r /tmp/apr$$ ] && rm -f /tmp/apr$$                [ -r /tmp/fix$$ ] && rm -f /tmp/fix$$                [ -r /tmp/tst$$ ] && rm -f /tmp/tst$$	fidone < /tmp/rpt$$rm /tmp/rpt$$

⌨️ 快捷键说明

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