userreport.sh
来自「CMVC是IBM和许多跨国公司的缺陷管理工具。这里给出了很多在Linux下用KS」· Shell 代码 · 共 665 行 · 第 1/2 页
SH
665 行
eval $SORT |awk -F"|" 'BEGIN {fm="%3.3s %6.6s %-15.15s %-8.8s %-8.8s %3.3s %-8.8s %-74.74s\n" tl="\n\nFeatures I ('$USER') own that require action now:" printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl)-2)}{ if (NR == 1) { printf fm,"pre", "feature", "compName", "state", "originLo", "age", "lastUpda", "abstract" printf fm,"---", "-------", "---------------", "--------", "--------", "---", "--------", "--------------------------------------------------------------------------" } printf fm,$1,$2,$3,$6,$17,$8,$10,$7}END { if (NR == 0) printf "None\n\n" else printf "\n" NR " record(s) selected\n\n"}'## -----------------------------------------------------------------------------# Features originated by USER that require action now# (sorted by feature number)# -----------------------------------------------------------------------------#SORT='sort -t"|" +1 -2 -n'#Report -view FeatureView -where "originLogin='$USER' and state='returned'" -raw |\eval $SORT |awk -F"|" 'BEGIN {fm="%3.3s %6.6s %-15.15s %-8.8s %-8.8s %-8.8s %-78.78s\n" tl="\n\nFeatures I ('$USER') originated that have been returned:" printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl)-2)}{ if (NR == 1) { printf fm,"pre", "feature", "compName", "ownerLog", "addDate", "lastUpdate", "abstract" printf fm,"---", "-------", "---------------", "--------", "--------", "--------", "------------------------------------------------------------------------------" } printf fm,$1,$2,$3,$4,$11,$10,$7}END { if (NR == 0) printf "None\n\n" else printf "\n" NR " record(s) selected\n\n"}'##echo "\n\n$SEPARATOR"echo "UPCOMING WORK"echo $SEPARATOR## -----------------------------------------------------------------------------# Reports in the following section:# o Test records owned by USER that are not ready# o Verify records owned by USER that are not ready# o Fix records owned by USER that are not ready# o Files checked out by USER# -----------------------------------------------------------------------------### -----------------------------------------------------------------------------# Test records owned by USER that are not ready# (sorted by number)# -----------------------------------------------------------------------------#SORT='sort -t"|" +2 -3 -n'#Report -view TestView -w "userLogin='$USER' and state in ('notReady')" -ra |eval $SORT |awk -F"|" 'BEGIN {fm="%3.3s %6.6s %-15.15s %-15.15s %-15.15s %-73.73s\n" tl="\n\nTest records I ('$USER') own that are not ready:" printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl)-2)}{ if (NR == 1) { printf fm,"pre", "name ", "releaseName", "envName", "reference", "Abstract" printf fm,"---", "------", "----------------", "----------------", "----------------", "-------------------------------------------------------------------------" } printf fm,$2,$3,$1,$4,$12,$9}END { if (NR == 0) printf "None\n\n" else printf "\n" NR " record(s) selected\n\n"}'## -----------------------------------------------------------------------------# Verify records owned by USER that are not ready# (sorted by number)# -----------------------------------------------------------------------------#SORT='sort -t"|" +0 -1 -n'#Report -vi VerifyView -w "userLogin='$USER' and state='notReady'" -ra |eval $SORT |awk -F"|" 'BEGIN {fm="%3.3s %6.6s %-15.15s %-15.15s %-8.8s %-8.8s %-71.71s\n" tl="\n\nVerify records I ('$USER') own that are not ready:" printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl)-2)}{ if (NR == 1) { printf fm,"pre", "name ", "area", "Reference", "addDate", "lastUpda", "Abstract" printf fm,"---", "------", "---------------", "---------------", "--------", "--------", "-----------------------------------------------------------------------" } printf fm,$10,$1,$5,$11,$3,$9,$8}END { if (NR == 0) printf "None\n\n" else printf "\n" NR " record(s) selected\n\n"}'## -----------------------------------------------------------------------------# Fix records owned by USER that are not ready# (sorted by number and release)# -----------------------------------------------------------------------------#SORT='sort -t"|" +0 -1 -n +1 -2'#Report -vi FixView -w \ "userLogin='$USER' and state='notReady'" -ra |eval $SORT |awk -F"|" 'BEGIN {fm="%3.3s %6.6s %-15.15s %-15.15s %-15.15s %-8.8s %-64.64s\n" tl="\n\nFix records I ('$USER') own that are not ready:" printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl)-2)}{ if (NR == 1) { printf fm,"pre", "name ", "Reference", "releaseName", "compName", "addDate", "Abstract" printf fm,"---", "------", "---------------", "---------------", "---------------", "--------", "----------------------------------------------------------------" } printf fm,$11,$1,$13,$2,$3,$8,$7}END { if (NR == 0) printf "None\n\n" else printf "\n" NR " record(s) selected\n\n"}'## -----------------------------------------------------------------------------# Files checked out by USER# (sorted by release and base name)# -----------------------------------------------------------------------------#SORT='sort -t"|" +1 -2 +0 -1'#Report -vi FilesOutView -w "userLogin='$USER'" -ra |eval $SORT |awk -F"|" 'BEGIN {fm="%-15.15s %-10.10s %-8.8s %-96.96s\n" tl="\n\nFiles I ('$USER') have checked out:" printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl)-2)}{ if (NR == 1) { printf fm,"releaseName", "newSID", "checkOutDate", "filePathName" printf fm,"---------------", "----------", "--------", "------------------------------------------------------------------------------------------------" } if (length($1) > 82) start = (length($1)-81) else start = 0; printf fm,$2,$4,$3,substr($1,start)}END { if (NR == 0) printf "None\n\n" else printf "\n" NR " record(s) selected\n\n"}'##echo "\n\n$SEPARATOR"echo "OTHER"echo $SEPARATOR## -----------------------------------------------------------------------------# Reports in the following section:# o Defects originated by USER# o Detail Report for all defects originated by USER# o Features originated by USER# o Defects owned by USER# o Features owned by USER# o Tracks owned by USER# -----------------------------------------------------------------------------### -----------------------------------------------------------------------------# Defects originated by USER (sorted by number)# -----------------------------------------------------------------------------#SORT='sort -t"|" +1 -2 -n'#Report -vi DefectView -w "originLogin='$USER' and not state in ('closed', 'canceled')" -ra |eval $SORT |awk -F"|" 'BEGIN {fm="%3.3s %6.6s %-15.15s %-15.15s %-8.8s %-8.8s %-3.3s %3.3s %-63.63s\n" tl="\n\nActive defects I ('$USER') created:" printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl)-2)}{ if (NR == 1) { printf fm,"pre", "name", "reference", "compName", "state", "ownerLog", "sev", "age", "abstract" printf fm,"---", "------", "---------------", "---------------", "--------", "--------", "---", "---", "---------------------------------------------------------------" } printf fm,$1,$2,$21,$3,$6,$5,$8,$10,$9}END { if (NR == 0) printf "None\n\n" else printf "\n" NR " record(s) selected\n\n"}'## -----------------------------------------------------------------------------# Features originated by USER (sorted by number)# -----------------------------------------------------------------------------#SORT='sort -t"|" +1 -2 -n'#Report -vi FeatureView -w "originLogin='$USER' and not state in ('closed', 'canceled')" -ra |eval $SORT |awk -F"|" 'BEGIN {fm="%3.3s %6.6s %-15.15s %-15.15s %-8.8s %-8.8s %-8.8s %-62.62s\n" tl="\n\nActive features I ('$USER') created:" printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl)-2)}{ if (NR == 1) { printf fm,"pre", "name", "reference", "compName", "state", "ownerLog", "lastUpdate", "abstract" printf fm,"---", "------", "---------------", "---------------", "--------", "--------", "--------", "--------------------------------------------------------------" } printf fm,$1,$2,$16,$3,$6,$4,$10,$7}END { if (NR == 0) printf "None\n\n" else printf "\n" NR " record(s) selected\n\n"}'## -----------------------------------------------------------------------------# Defects owned by USER (sorted by number)# -----------------------------------------------------------------------------#SORT='sort -t"|" +1 -2 -n'#Report -vi DefectView -w "ownerLogin='$USER' and not state in ('closed', 'canceled')" -ra |eval $SORT |awk -F"|" 'BEGIN {fm="%3.3s %6.6s %-15.15s %-15.15s %-8.8s %-8.8s %-3.3s %3.3s %-63.63s\n" tl="\n\nActive defects I ('$USER') own:" printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl)-2)}{ if (NR == 1) { printf fm,"pre", "name", "reference", "compName", "state", "originLo", "sev", "age", "abstract" printf fm,"---", "------", "---------------", "---------------", "--------", "--------", "---", "---", "---------------------------------------------------------------" } printf fm,$1,$2,$21,$3,$6,$22,$8,$10,$9}END { if (NR == 0) printf "None\n\n" else printf "\n" NR " record(s) selected\n\n"}'## -----------------------------------------------------------------------------# Features owned by USER (sorted by number)# -----------------------------------------------------------------------------#SORT='sort -t"|" +1 -2 -n'#Report -vi FeatureView -w "ownerLogin='$USER' and not state in ('closed', 'canceled')" -ra |eval $SORT |awk -F"|" 'BEGIN {fm="%3.3s %6.6s %-15.15s %-15.15s %-8.8s %-8.8s %-8.8s %-62.62s\n" tl="\n\nActive features I ('$USER') own:" printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl)-2)}{ if (NR == 1) { printf fm,"pre", "name", "reference", "compName", "state", "originLo", "lastUpdate", "abstract" printf fm,"---", "------", "---------------", "---------------", "--------", "--------", "--------", "--------------------------------------------------------------" } printf fm,$1,$2,$16,$3,$6,$17,$10,$7}END { if (NR == 0) printf "None\n\n" else printf "\n" NR " record(s) selected\n\n"}'## -----------------------------------------------------------------------------# Tracks owned by USER# -----------------------------------------------------------------------------#SORT='sort -t"|" +0 -1 +1 -2 -n'#Report -vi TrackView -w "userLogin='$USER' and state <> 'complete'" -raw |eval $SORT |awk -F"|" 'BEGIN {fm="%3.3s %6.6s %-15.15s %-9.9s %-9.9s %-8.8s %-8.8s %-67.67s\n" tl="\n\nActive tracks I ('$USER') own:" printf "\n\n%s\n%s\n\n", tl, substr("'$SEPARATOR'", 1, length(tl)-2)}{ if (NR == 1) { printf fm,"pre", "name ", "releaseName", "state", "target", "addDate", "lastUpdate", "abstract" printf fm,"---", "------", "---------------", "---------", "---------", "--------", "--------", "-------------------------------------------------------------------" } printf fm,$12,$2,$1,$4,$5,$6,$11,$13}END { if (NR == 0) printf "None\n\n" else printf "\n" NR " record(s) selected\n\n"}'exit# end of file
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?