Advertisement
Guest User

Untitled

a guest
May 17th, 2017
667
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.29 KB | None | 0 0
  1. #!/bin/bash
  2. #
  3. #
  4.  
  5. #priority=( P1 P2 P3 P4 P5 )
  6. priority=( P4 P5 )
  7. priority_count=${#priority[@]}
  8.  
  9. search_strings[0]="search -u jakub_havlik@post.cz -p Harman^7 -w software-l10n --status=NEW"
  10. search_strings[1]="search -u jakub_havlik@post.cz -p Harman^7 -w software-l10n --status=ACCEPTED"
  11. #search_strings[2]="search -u jakub_havlik@post.cz -p Harman^7 -w software-l10n --status=CLOSED"
  12. search_strings_count=${#search_strings[@]}
  13.  
  14.  
  15.  
  16. search_software_l10n="search -u jakub_havlik@post.cz -p Harman^7 -w software-l10n --status=all"
  17. parse_bug_ids="sed -n -r s/^([[:digit:]]+).*/\1/p"
  18. send_ids_to_bugz="xargs -n 1 bugz get -u jakub_havlik@post.cz -p Harman^7 -f "
  19. parse_links='sed -n -r \"s/(URL.*: )(http:\/\/defect.opensolaris.org\/bz\/show_bug.cgi.*)/\2/p\"'
  20.  
  21.  
  22.  
  23. for (( j = 0 ; j < $search_strings_count ; j++ ))
  24.     do
  25.       pom=0
  26.       for (( i = 0 ; i < $priority_count ; i++ ))
  27.         do      # string to array
  28.           ids_string_i=$(bugz ${search_strings[$j]} --priority=${priority[$i]} | $parse_bug_ids)
  29.           if [ $(printf "%b\n" $ids_string_i | wc -w) -ge 1 ]
  30.             then
  31.               ids_string_all=$ids_string_all$ids_string_i"\n"
  32.           fi
  33.  
  34.           soucet[$(( ($priority_count+1) * $j + $i))]=$(printf "%b\n"  $ids_string_i | wc -l)
  35.           pom=$(( $pom + soucet[$(( ($priority_count+1) * $j + $i))]))
  36.       done
  37.       ids[$j]=${idsi[*]}
  38.       soucet[$(( ($priority_count+1) * $j + $priority_count))]=$pom
  39. done
  40.  
  41.  
  42. string="<table border="1">\n<tr>\n"
  43. for (( j = 0 ; j < $priority_count ; j++ ))
  44.     do
  45.       string=$string$"<td>"${priority[$j]}"</td>\n"
  46.     done
  47. string=$string$"<td>sum</td>\n</tr>\n"
  48. for (( j = 0 ; j < $search_strings_count ; j++ ))
  49.     do
  50.       string=$string"<tr>\n"
  51.       for (( i = 0 ; i < $priority_count+1; i++ ))
  52.         do
  53.         string=$string"<td>"${soucet[$(( ($priority_count+1) * $j + $i))]}"</td>\n"
  54.       done
  55.       string=$string"</tr>\n"
  56. done
  57. string=$string"</table>"
  58.  
  59. printf "%b\n" "$string" # zobrazeni tabulky s pocty bugu
  60.  
  61. printf "%b\n" "$ids_string_all" > cisla # nic lepsino nez to ulozit do souboru a z nej to nacitat mi nefunguje
  62.  
  63. while read bug
  64.     do
  65.       bugy[$(( i++ ))]=$(bugz get -u jakub_havlik@post.cz -p Harman^7 -f $bug)
  66.       echo -e ${bugy[$(( i-1 ))]}
  67. done < cisla # jmeno docasneho souboru
  68.  
  69. #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