Advertisement
szabozoltan69

Untitled

Nov 19th, 2012
150
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. fromdos TOPROD TOOFFR
  4. grep '|' TOPROD|grep -vi select |sed 's/ *//g;s/^/$q[/;s/x/]=array(/;s/|/,/;s/\:/,\"/;s/$/\"\)\;/' > TOPROD_
  5. grep '|' TOOFFR|grep -vi select |perl -p -w -e \
  6. 's/ *//g;s/^(.*)x(.*)\|(.*)\:(.*)\+(.*)$/\$ofpr[$1][]\=$2\; \$ofpw[$1][$2]\="$4"\; $3/;' - > TOOFFR_
  7. grep '|' TOOFFR_BYHAND          |perl -p -w -e \
  8. 's/ *//g;s/^(.*)x(.*)\|(.*)\:(.*)\+(.*)$/\$ofpr[$1][]\=$2\; \$ofpw[$1][$2]\="$4"\; $3/;' - >> TOOFFR_
  9. grep '|' TOOFFR_DIGIFON         |perl -p -w -e \
  10. 's/ *//g;s/^(.*)x(.*)\|(.*)\:(.*)\+(.*)$/\$ofpr[$1][]\=$2\; \$ofpw[$1][$2]\="$4"\; $3/;' - >> TOOFFR_
  11. #'s/ *//g;s/^(.*)x(.*)\|(.*)\:(.*)\+(.*)$/\$ofpr[$1][]\=$2\; \$ofpw[$1][$2]\="$4"\; \$ofel[$1][$2]\=$5\; $3/;' - > TOOFFR_
  12.  
  13. php change_n2i.php -a change_n2i > change_n2i.doit
  14. chmod 755                          change_n2i.doit
  15.                                  ./change_n2i.doit
  16.  
  17. f=alloffers_
  18. #m g=_product
  19. h=mindenusp_ #h=uspoffers_ - nem ezt használjuk
  20. j=tdsloffers_
  21. #k masra kell
  22. l=_VOIP
  23.  
  24. echo "<?php" > $f\n
  25. echo "<?php" > $f\i
  26. #m echo "<?php" > $g
  27.  
  28. grep    " N$" TOOFFR_ |sed 's/ N$//'>> $f\n
  29. grep -v " N$" TOOFFR_ |sed 's/ .$//'>> $f\i
  30.  
  31. #Kiküszöbölendő offerek
  32. k=kiv_
  33. cp $f\i $k\i
  34. cp $f\n $k\n
  35. cat noff        |xargs -iQ perl -pi -w -e 's/^(\$ofpr\['Q'\])/\/\/$1/' $k\i
  36. cat noff        |xargs -iQ perl -pi -w -e 's/^(\$ofpr\['Q'\])/\/\/$1/' $k\n
  37. cat noff_DIGIFON|xargs -iQ perl -pi -w -e 's/^(\$ofpr\['Q'\])/\/\/$1/' $k\i
  38. cat noff_DIGIFON|xargs -iQ perl -pi -w -e 's/^(\$ofpr\['Q'\])/\/\/$1/' $k\n
  39. mv $k\i $f\i
  40. mv $k\n $f\n
  41.  
  42. #korábbi make_alluspnrs
  43. echo '<?php $alluspnrs=array('                   >_alluspnrs
  44. grep USPP TOPROD|perl -p -w -e's/^ +//;s/ .*/,/'>>_alluspnrs
  45. A=$(tail -n1 _alluspnrs); B=$(echo $A|sed 's/,//'); perl -pi -w -e "s/^$A\n/$B/" _alluspnrs
  46. echo ');?>'                                     >>_alluspnrs
  47.  
  48. echo "<?php" > $h\n
  49. echo "<?php" > $h\i
  50. uspmeret=$(cat _alluspnrs|wc -l)
  51. for i in $(/usr/bin/seq 2 $uspmeret); do
  52. #vhogy elromlott: USP=$(cat _alluspnrs|awk -F',|)' "NR==$i {print \$1 }");
  53. USP=$(cat _alluspnrs|perl -p -w -e 's/,//g;s/\).*//g' - |awk "NR==$i {print $1 }");
  54.  
  55. #echo "QQQQQ" $USP >>$h\n
  56. #echo "QQQQQ" $USP >>$h\i
  57. grep "\=$USP\;" $f\n $f\i|perl -p -w -e 's/.*?\[(.*?)\].*/$1/' -|xargs -iQ grep 'ofpr\['Q $f\n>>$h\n
  58. grep "\=$USP\;" $f\n $f\i|perl -p -w -e 's/.*?\[(.*?)\].*/$1/' -|xargs -iQ grep 'ofpr\['Q $f\i>>$h\i
  59. #Nem hiba itt a két^^ fájl, mert először csak az offer_nr-eket keressük
  60. #x eredeti egyusp-s: grep "\=$USP\;" $f\n $f\i|perl -p -w -e 's/.*?\[(.*?)\].*/$1/' -|xargs -iQ grep 'ofpr\['Q $f\n>>$h\n
  61. #x eredeti egyusp-s: grep "\=$USP\;" $f\n $f\i|perl -p -w -e 's/.*?\[(.*?)\].*/$1/' -|xargs -iQ grep 'ofpr\['Q $f\i>>$h\i
  62. done
  63. echo "?>"   >> $h\n
  64. echo "?>"   >> $h\i
  65.  
  66. echo "<?php" > $j\n
  67. echo "<?php" > $j\i
  68. cat tdsl|xargs -iQ grep 'ofpr\['Q $f\i>>$j\i
  69. cat tdsl|xargs -iQ grep 'ofpr\['Q $f\n>>$j\n
  70. echo "?>"   >> $j\n
  71. echo "?>"   >> $j\i
  72.  
  73. perl -p -w -e 's/^(.*?)\t.*?\t.*?\t.*?\t(.*?)/$1:$2/' $l |sort -u > $l\_dict # Azaz ebből ezt: VSZLA   N   40395   EGYN    VOIP_SZLACSOKK_2010_tech =>VSZLA:VOIP_SZLACSOKK_2010_tech
  74.  
  75. echo '<?php' > $l\_i
  76. echo '<?php' > $l\_n
  77. grep '  I   ' $l | perl -p -w -e 's/^(.*?)\t.*?\t(.*?)\t(.*?)\t.*?$/\$ofpr\["$1"\]\[\]=$2\;  \$ofpw\["$1"\]\[$2\]="$3"\;/' - >> $l\_i
  78. grep '  N   ' $l | perl -p -w -e 's/^(.*?)\t.*?\t(.*?)\t(.*?)\t.*?$/\$ofpr\["$1"\]\[\]=$2\;  \$ofpw\["$1"\]\[$2\]="$3"\;/' - >> $l\_n
  79. grep '  I   ' $l | perl -p -w -e 's/^(.*?)\t.*?\t(.*?)\t(.*?)\t.*?$/\$ofpr\["$1"\]\[\]=$2\;  \$ofpw\["$1"\]\[$2\]="$3"\;/' - |grep -v '\[\"1' >> $f\i #alloffers-be is - de a már meglevő számosokat kiszűrjük. Lesznek betűvel ábrázolt offeres duplikációk
  80. grep '  N   ' $l | perl -p -w -e 's/^(.*?)\t.*?\t(.*?)\t(.*?)\t.*?$/\$ofpr\["$1"\]\[\]=$2\;  \$ofpw\["$1"\]\[$2\]="$3"\;/' - |grep -v '\[\"1' >> $f\n #alloffers-be is - de a már meglevő számosokat kiszűrjük. Lesznek betűvel ábrázolt offeres duplikációk
  81. echo '?>' >> $l\_i
  82. echo '?>' >> $l\_n
  83. echo '?>' >> $f\n
  84. echo '?>' >> $f\i
  85.  
  86. wget http://127.0.0.1/$(cat ~/bin/k)/csillagell.php?switch=1 -q -O mindenusp_csillagl
  87. wget http://127.0.0.1/$(cat ~/bin/k)/csillagell.php?switch=2 -q -O mindenusp_plusz
  88.  
  89. exit 0
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement