Advertisement
szabozoltan69

Untitled

Nov 19th, 2012
162
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.  
  12. php change_n2i.php -a change_n2i > change_n2i.doit
  13. chmod 755                          change_n2i.doit
  14.                                  ./change_n2i.doit
  15.  
  16. f=alloffers_
  17. #m g=_product
  18. h=mindenusp_ #h=uspoffers_ - nem ezt használjuk
  19. j=tdsloffers_
  20. #k masra kell
  21. l=_VOIP
  22.  
  23. echo "<?php" > $f\n
  24. echo "<?php" > $f\i
  25. #m echo "<?php" > $g
  26.  
  27. grep    " N$" TOOFFR_ |sed 's/ N$//'>> $f\n
  28. grep -v " N$" TOOFFR_ |sed 's/ .$//'>> $f\i
  29.  
  30. #Kiküszöbölendő offerek
  31. k=kiv_
  32. cp $f\i $k\i
  33. cp $f\n $k\n
  34. cat noff        |xargs -iQ perl -pi -w -e 's/^(\$ofpr\['Q'\])/\/\/$1/' $k\i
  35. cat noff        |xargs -iQ perl -pi -w -e 's/^(\$ofpr\['Q'\])/\/\/$1/' $k\n
  36. cat noff_DIGIFON|xargs -iQ perl -pi -w -e 's/^(\$ofpr\['Q'\])/\/\/$1/' $k\i
  37. cat noff_DIGIFON|xargs -iQ perl -pi -w -e 's/^(\$ofpr\['Q'\])/\/\/$1/' $k\n
  38. mv $k\i $f\i
  39. mv $k\n $f\n
  40.  
  41. #korábbi make_alluspnrs
  42. echo '<?php $alluspnrs=array('                   >_alluspnrs
  43. grep USPP TOPROD|perl -p -w -e's/^ +//;s/ .*/,/'>>_alluspnrs
  44. A=$(tail -n1 _alluspnrs); B=$(echo $A|sed 's/,//'); perl -pi -w -e "s/^$A\n/$B/" _alluspnrs
  45. echo ');?>'                                     >>_alluspnrs
  46.  
  47. echo "<?php" > $h\n
  48. echo "<?php" > $h\i
  49. uspmeret=$(cat _alluspnrs|wc -l)
  50. for i in $(/usr/bin/seq 2 $uspmeret); do
  51. #vhogy elromlott: USP=$(cat _alluspnrs|awk -F',|)' "NR==$i {print \$1 }");
  52. USP=$(cat _alluspnrs|perl -p -w -e 's/,//g;s/\).*//g' - |awk "NR==$i {print $1 }");
  53.  
  54. grep "\=$USP\;" $f\n $f\i|perl -p -w -e 's/.*?\[(.*?)\].*/$1/' -|xargs -iQ grep 'ofpr\['Q $f\n>>$h\n
  55. grep "\=$USP\;" $f\n $f\i|perl -p -w -e 's/.*?\[(.*?)\].*/$1/' -|xargs -iQ grep 'ofpr\['Q $f\i>>$h\i
  56. #Nem hiba itt a két^^ fájl, mert először csak az offer_nr-eket keressük
  57. done
  58. echo "?>"   >> $h\n
  59. echo "?>"   >> $h\i
  60.  
  61. echo "<?php" > $j\n
  62. echo "<?php" > $j\i
  63. cat tdsl|xargs -iQ grep 'ofpr\['Q $f\i>>$j\i
  64. cat tdsl|xargs -iQ grep 'ofpr\['Q $f\n>>$j\n
  65. echo "?>"   >> $j\n
  66. echo "?>"   >> $j\i
  67.  
  68. 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
  69.  
  70. echo '<?php' > $l\_i
  71. echo '<?php' > $l\_n
  72. grep '  I   ' $l | perl -p -w -e 's/^(.*?)\t.*?\t(.*?)\t(.*?)\t.*?$/\$ofpr\["$1"\]\[\]=$2\;  \$ofpw\["$1"\]\[$2\]="$3"\;/' - >> $l\_i
  73. grep '  N   ' $l | perl -p -w -e 's/^(.*?)\t.*?\t(.*?)\t(.*?)\t.*?$/\$ofpr\["$1"\]\[\]=$2\;  \$ofpw\["$1"\]\[$2\]="$3"\;/' - >> $l\_n
  74. 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
  75. 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
  76. echo '?>' >> $l\_i
  77. echo '?>' >> $l\_n
  78. echo '?>' >> $f\n
  79. echo '?>' >> $f\i
  80.  
  81. wget http://127.0.0.1/$(cat ~/bin/k)/csillagell.php?switch=1 -q -O mindenusp_csillagl
  82. wget http://127.0.0.1/$(cat ~/bin/k)/csillagell.php?switch=2 -q -O mindenusp_plusz
  83.  
  84. exit 0
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement