managerreport.sh

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

SH
425
字号
## -----------------------------------------------------------------------------#       Active features owned by Area#       Un-comment one desired "sort" option.# -----------------------------------------------------------------------------#SORT='sort -t"|" +1 -2 -n +2 -3'    # number, component#SORT='sort -t"|" +1 -2'            # numberReport -vi FeatureView -w "ownerArea in ($DEPTS) and state in ('open','design')" -raw |eval $SORT |awk -F"|" 'BEGIN {    fm="%3.3s %6.6s %-8.8s %-15.15s %-8.8s %-8.8s %-3.3s %-74.74s\n"    tl="Active features owned by personnel in area(s) '$DEPTS':"    printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl))}{    if (NR == 1) {        printf fm, "pre", "name", "ownerLog", "compName", "state", "originLo", "age", "abstract"        printf fm, "---", "------", "--------", "---------------", "--------", "--------", "---", "--------------------------------------------------------------------------"    }    printf fm,$1,$2,$4,$3,$6,$17,$8,$7}END {    if (NR == 0)        printf "None\n\n"    else                printf "\n" NR " record(s) selected\n\n"}'## -----------------------------------------------------------------------------#       Returned features originated by Area# -----------------------------------------------------------------------------#SORT='sort -t"|" +1 -2 -n +2 -3'    # number, componentReport -vi FeatureView -w "originArea in ($DEPTS) and state='returned'" -raw |eval $SORT |awk -F"|" 'BEGIN {    fm="%3.3s %6.6s %-8.8s %-15.15s %-8.8s %-3.3s %-83.83s\n"    tl="Features originated by personnel in area(s) '$DEPTS' that have been returned:"    printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl))}{    if (NR == 1) {        printf fm, "pre", "name", "ownerLog", "compName", "originLo", "age", "abstract"        printf fm, "---", "------", "--------", "---------------", "--------", "---", "-----------------------------------------------------------------------------------"    }    printf fm,$1,$2,$4,$3,$17,$8,$7}END {    if (NR == 0)        printf "None\n\n"    else                printf "\n" NR " record(s) selected\n\n"}'## -----------------------------------------------------------------------------#       Fix records in Area# -----------------------------------------------------------------------------#SORT='sort -t"|" +0 -1 -n +1 -2'    # defect, releaseReport -vi FixView -w "userArea in ($DEPTS) and state='ready'" -raw |eval $SORT |awk -F"|" 'BEGIN {    fm="%3.3s %6.6s %-15.15s %-15.15s %-8.8s %-80.80s\n"    tl="Fix records in area(s) '$DEPTS' that are ready:"    printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl))}{    if (NR == 1) {        printf fm, "pre", "name  ", "release", "compName", "addDate", "abstract"        printf fm, "---", "------", "---------------", "---------------", "--------", "--------------------------------------------------------------------------------"    }    printf fm,$11,$1,$2,$3,$8,$7}END {    if (NR == 0)        printf "None\n\n"    else                printf "\n" NR " record(s) selected\n\n"}'echo "\n\n"echo $SEPARATORecho "UPCOMING WORK"echo $SEPARATOR## -----------------------------------------------------------------------------#       Test records owned by dept that are notReady# -----------------------------------------------------------------------------#SORT='sort -t"|" +2 -3 -n'Report -vi TestView -w "userArea in ($DEPTS) and state in ('notReady')" -ra |\eval $SORT |awk -F"|" 'BEGIN {    fm="%3.3s %6.6s %-15.15s %-15.15s %-15.15s %-8.8s %-8.8s %-55.55s\n"    tl="Test records owned by personnel in area(s) '$DEPTS' that are not ready:"    printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl))}{    if (NR == 1) {        printf fm,"pre", "name  ", "releaseName", "envName", "Reference", "lastUpda", "addDate", "Abstract"        printf fm, "---", "------", "----------------", "----------------", "---------------", "--------", "--------", "-------------------------------------------------------"    }    printf fm,$2,$3,$1,$4,$12,$7,$6,$9}END {    if (NR == 0)        printf "None\n\n"    else                printf "\n" NR " record(s) selected\n\n"}'## -----------------------------------------------------------------------------#       Fix records in the area that are not ready.# -----------------------------------------------------------------------------#SORT='sort -t"|" +0 -1 -n +1 -2'    # defect, releaseReport -vi FixView -w "userArea in ($DEPTS) and state='notReady'" -raw |eval $SORT |awk -F"|" 'BEGIN {    fm="%3.3s %6.6s %-15.15s %-15.15s %-8.8s %-80.80s\n"    tl="Fix records in area(s) '$DEPTS' that are not ready:"    printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl))}{    if (NR == 1) {        printf fm, "pre", "name  ", "release", "compName", "addDate", "abstract"        printf fm, "---", "------", "---------------", "---------------", "-----------------", "--------------------------------------------------------------------------------"    }    printf fm,$11,$1,$2,$3,$8,$7}END {    if (NR == 0)        printf "None\n\n"    else                printf "\n" NR " record(s) selected\n\n"}'echo "\n\n"echo $SEPARATORecho "CURRENT WORK"echo $SEPARATOR## -----------------------------------------------------------------------------#       Active ('working') Defects by Area#       Un-comment one desired "sort" option.# -----------------------------------------------------------------------------#SORT='sort -t"|" +8 -9 +1 -2 -n +3 -4'    # severity, number, release#SORT='sort -t"|" +1 -2 -n'Report -vi DefectView -w "ownerArea in ($DEPTS) and state not in ('canceled','closed')" -raw |eval $SORT |awk -F"|" 'BEGIN {    fm="%3.3s %6.6s %-8.8s %-15.15s %-8.8s %-8.8s %-3.3s %-3.3s %-70.70s\n"    tl="Active defects owned by area(s) '$DEPTS':"    printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl))}{    if (NR == 1) {        printf fm, "pre", "name", "ownerLog", "compName", "state", "originLo", "sev", "age", "abstract"        printf fm, "---", "------", "--------", "---------------", "--------", "--------", "---", "---", "----------------------------------------------------------------------"    }    printf fm,$1,$2,$5,$3,$6,$22,$8,$10,$9}END {    if (NR == 0)        printf "None\n\n"    else                printf "\n" NR " record(s) selected\n\n"}'## -----------------------------------------------------------------------------#       Fix records in the area that are active or ready# -----------------------------------------------------------------------------#SORT='sort -t"|" +0 -1 -n +1 -2'    # defect, releaseReport -vi FixView -w "userArea in ($DEPTS) and state in ('active','ready')" -raw |eval $SORT |awk -F"|" 'BEGIN {    fm="%3.3s %6.6s %-15.15s %-15.15s %-8.8s %-8.8s %-71.71s\n"    tl="Fix records that are active in area(s) '$DEPTS':"    printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl))}{    if (NR == 1) {        printf fm, "pre", "name  ", "release", "compName", "state", "addDate", "abstract"        printf fm, "---", "------", "---------------", "---------------", "--------", "--------", "-----------------------------------------------------------------------"    }    printf fm,$11,$1,$2,$3,$4,$8,$7}END {    if (NR == 0)        printf "None\n\n"    else                printf "\n" NR " record(s) selected\n\n"}'

⌨️ 快捷键说明

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