Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- #
- #priority=( P1 P2 P3 P4 P5 )
- priority=( P4 P5 )
- priority_count=${#priority[@]}
- search_strings[0]="search -u jakub_havlik@post.cz -p Harman^7 -w software-l10n --status=NEW"
- search_strings[1]="search -u jakub_havlik@post.cz -p Harman^7 -w software-l10n --status=ACCEPTED"
- #search_strings[2]="search -u jakub_havlik@post.cz -p Harman^7 -w software-l10n --status=CLOSED"
- search_strings_count=${#search_strings[@]}
- search_software_l10n="search -u jakub_havlik@post.cz -p Harman^7 -w software-l10n --status=all"
- parse_bug_ids="sed -n -r s/^([[:digit:]]+).*/\1/p"
- send_ids_to_bugz="xargs -n 1 bugz get -u jakub_havlik@post.cz -p Harman^7 -f "
- parse_links='sed -n -r \"s/(URL.*: )(http:\/\/defect.opensolaris.org\/bz\/show_bug.cgi.*)/\2/p\"'
- for (( j = 0 ; j < $search_strings_count ; j++ ))
- do
- pom=0
- for (( i = 0 ; i < $priority_count ; i++ ))
- do # string to array
- ids_string_i=$(bugz ${search_strings[$j]} --priority=${priority[$i]} | $parse_bug_ids)
- if [ $(printf "%b\n" $ids_string_i | wc -w) -ge 1 ]
- then
- ids_string_all=$ids_string_all$ids_string_i"\n"
- fi
- soucet[$(( ($priority_count+1) * $j + $i))]=$(printf "%b\n" $ids_string_i | wc -l)
- pom=$(( $pom + soucet[$(( ($priority_count+1) * $j + $i))]))
- done
- ids[$j]=${idsi[*]}
- soucet[$(( ($priority_count+1) * $j + $priority_count))]=$pom
- done
- string="<table border="1">\n<tr>\n"
- for (( j = 0 ; j < $priority_count ; j++ ))
- do
- string=$string$"<td>"${priority[$j]}"</td>\n"
- done
- string=$string$"<td>sum</td>\n</tr>\n"
- for (( j = 0 ; j < $search_strings_count ; j++ ))
- do
- string=$string"<tr>\n"
- for (( i = 0 ; i < $priority_count+1; i++ ))
- do
- string=$string"<td>"${soucet[$(( ($priority_count+1) * $j + $i))]}"</td>\n"
- done
- string=$string"</tr>\n"
- done
- string=$string"</table>"
- printf "%b\n" "$string" # zobrazeni tabulky s pocty bugu
- printf "%b\n" "$ids_string_all" > cisla # nic lepsino nez to ulozit do souboru a z nej to nacitat mi nefunguje
- while read bug
- do
- bugy[$(( i++ ))]=$(bugz get -u jakub_havlik@post.cz -p Harman^7 -f $bug)
- echo -e ${bugy[$(( i-1 ))]}
- done < cisla # jmeno docasneho souboru
- #echo $ids_string_all | $send_ids_to_bugz | sed -n -r "s/(URL.*: )(http:\/\/defect.opensolaris.org\/bz\/show_bug.cgi.*)/\2/p"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement