2607

grep_test.sh

Dec 5th, 2021
899
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. echo "---Grep tests---"
  2. echo "->tests -l"
  3. ./s21_grep -l -e if ttt.txt >1
  4. grep -l -e if ttt.txt >2
  5. diff -s 1 2
  6. ./s21_grep -l -e for -e if ttt.txt >1
  7. grep -l -e for -e if ttt.txt >2
  8. diff -s 1 2
  9. ./s21_grep -li -e for -e if ttt.txt >1
  10. grep -li -e for -e if ttt.txt >2
  11. diff -s 1 2
  12. ./s21_grep -l -e return ttt.txt >1
  13. grep -l -e return ttt.txt >2
  14. diff -s 1 2
  15. ./s21_grep -lv -e return ttt.txt >1
  16. grep -lv -e return ttt.txt >2
  17. diff -s 1 2
  18. ./s21_grep -li -e IF ttt.txt >1
  19. grep -li -e IF ttt.txt >2
  20. diff -s 1 2
  21. ./s21_grep -lin -e IF ttt.txt >1
  22. grep -lin -e IF ttt.txt >2
  23. diff -s 1 2
  24. ./s21_grep -liv -e IF ttt.txt >1
  25. grep -liv -e IF ttt.txt >2
  26. diff -s 1 2
  27. ./s21_grep -l -e argv ttt.txt file.txt >1
  28. grep -l -e argv ttt.txt file.txt >2
  29. diff -s 1 2
  30. ./s21_grep -lv -e argv ttt.txt file.txt >1
  31. grep -lv -e argv ttt.txt file.txt >2
  32. diff -s 1 2
  33. ./s21_grep -l -e argv ttt.txt file.txt1 >1
  34. grep -l -e argv ttt.txt file.txt1 >2
  35. diff -s 1 2
  36. ./s21_grep -ls -e argv ttt.txt file.txt1 >1
  37. grep -ls -e argv ttt.txt file.txt1 >2
  38. diff -s 1 2
  39. echo "end->tests -l"
  40. echo "->tests -o"
  41. ./s21_grep -o -e if ttt.txt >1
  42. grep -o -e if ttt.txt >2
  43. diff -s 1 2
  44. ./s21_grep -o -e for -e if ttt.txt >1
  45. grep -o -e for -e if ttt.txt >2
  46. diff -s 1 2
  47. ./s21_grep -oi -e for -e if ttt.txt >1
  48. grep -oi -e for -e if ttt.txt >2
  49. diff -s 1 2
  50. ./s21_grep -oin -e for -e if ttt.txt >1
  51. grep -oin -e for -e if ttt.txt >2
  52. diff -s 1 2
  53. ./s21_grep -oin -e for -e if ttt.txt file.txt >1
  54. grep -oin -e for -e if ttt.txt file.txt >2
  55. diff -s 1 2
  56. ./s21_grep -oin -e ty -e if ttt.txt file.txt >1
  57. grep -oin -e ty -e if ttt.txt file.txt >2
  58. diff -s 1 2
  59. ./s21_grep -oinv -e for -e if ttt.txt >1
  60. grep -oinv -e for -e if ttt.txt >2
  61. diff -s 1 2
  62. ./s21_grep -o -e return ttt.txt >1
  63. grep -o -e return ttt.txt >2
  64. diff -s 1 2
  65. ./s21_grep -ov -e return ttt.txt >1
  66. grep -ov -e return ttt.txt >2
  67. diff -s 1 2
  68. ./s21_grep -oi -e IF ttt.txt >1
  69. grep -oi -e IF ttt.txt >2
  70. diff -s 1 2
  71. ./s21_grep -oin -e IF ttt.txt >1
  72. grep -oin -e IF ttt.txt >2
  73. diff -s 1 2
  74. ./s21_grep -oiv -e IF ttt.txt >1
  75. grep -oiv -e IF ttt.txt >2
  76. diff -s 1 2
  77. ./s21_grep -o -e for ttt.txt file.txt >1
  78. grep -o -e for ttt.txt file.txt >2
  79. diff -s 1 2
  80. ./s21_grep -o -e argv ttt.txt file.txt >1
  81. grep -o -e argv ttt.txt file.txt >2
  82. diff -s 1 2
  83. ./s21_grep -ov -e argv ttt.txt file.txt >1
  84. grep -ov -e argv ttt.txt file.txt >2
  85. diff -s 1 2
  86. ./s21_grep -o -e argv ttt.txt file.txt1 >1
  87. grep -o -e argv ttt.txt file.txt1 >2
  88. diff -s 1 2
  89. ./s21_grep -oh -e argv ttt.txt file.txt >1
  90. grep -oh -e argv ttt.txt file.txt >2
  91. diff -s 1 2
  92. ./s21_grep -ovh -e argv ttt.txt file.txt >1
  93. grep -ovh -e argv ttt.txt file.txt >2
  94. diff -s 1 2
  95. ./s21_grep -onh -e argv ttt.txt file.txt1 >1
  96. grep -onh -e argv ttt.txt file.txt1 >2
  97. diff -s 1 2
  98. ./s21_grep -os -e argv ttt.txt file.txt1 >1
  99. grep -os -e argv ttt.txt file.txt1 >2
  100. diff -s 1 2
  101. ./s21_grep -ohs -e argv ttt.txt file.txt1 >1
  102. grep -ohs -e argv ttt.txt file.txt1 >2
  103. diff -s 1 2
  104. echo "end->tests -o"
  105. echo "->tests -c"
  106. ./s21_grep -c -e if ttt.txt >1
  107. grep -c -e if ttt.txt  >2
  108. diff -s 1 2
  109. ./s21_grep -c -e for -e if ttt.txt >1
  110. grep -c -e for -e if ttt.txt  >2
  111. diff -s 1 2
  112. ./s21_grep -ci -e for -e if ttt.txt >1
  113. grep -ci -e for -e if ttt.txt  >2
  114. diff -s 1 2
  115. ./s21_grep -c -e return ttt.txt >1
  116. grep -c -e return ttt.txt  >2
  117. diff -s 1 2
  118. ./s21_grep -cv -e return ttt.txt >1
  119. grep -cv -e return ttt.txt  >2
  120. diff -s 1 2
  121. ./s21_grep -ci -e IF ttt.txt >1
  122. grep -ci -e IF ttt.txt  >2
  123. diff -s 1 2
  124. ./s21_grep -cin -e IF ttt.txt >1
  125. grep -cin -e IF ttt.txt  >2
  126. diff -s 1 2
  127. ./s21_grep -civ -e IF ttt.txt >1
  128. grep -civ -e IF ttt.txt  >2
  129. diff -s 1 2
  130. ./s21_grep -c -e argv ttt.txt file.txt >1
  131. grep -c -e argv ttt.txt file.txt  >2
  132. diff -s 1 2
  133. ./s21_grep -cv -e argv ttt.txt file.txt >1
  134. grep -cv -e argv ttt.txt file.txt  >2
  135. diff -s 1 2
  136. ./s21_grep -c -e argv ttt.txt file.txt1 >1
  137. grep -c -e argv ttt.txt file.txt1  >2
  138. diff -s 1 2
  139. ./s21_grep -ch -e argv ttt.txt file.txt >1
  140. grep -ch -e argv ttt.txt file.txt  >2
  141. diff -s 1 2
  142. ./s21_grep -cvh -e argv ttt.txt file.txt >1
  143. grep -cvh -e argv ttt.txt file.txt  >2
  144. diff -s 1 2
  145. ./s21_grep -ch -e argv ttt.txt file.txt1 >1
  146. grep -ch -e argv ttt.txt file.txt1  >2
  147. diff -s 1 2
  148. ./s21_grep -chs -e argv ttt.txt file.txt1 >1
  149. grep -chs -e argv ttt.txt file.txt1  >2
  150. diff -s 1 2
  151. echo "end->tests -c"
  152. echo "->tests -f"
  153. ./s21_grep -f file.txt ttt.txt >1
  154. grep -f file.txt ttt.txt  >2
  155. diff -s 1 2
  156. ./s21_grep -e while -f file.txt ttt.txt >1
  157. grep -e while -f file.txt ttt.txt  >2
  158. diff -s 1 2
  159. ./s21_grep -e while -eerror -f file.txt ttt.txt >1
  160. grep -e while -eerror -f file.txt ttt.txt  >2
  161. diff -s 1 2
  162. ./s21_grep -e while -e end -f file.txt ttt.txt >1
  163. grep -e while -e end -f file.txt ttt.txt  >2
  164. diff -s 1 2
  165. #./s21_grep while -f file.txt ttt.txt >1
  166. #grep while -f file.txt ttt.txt  >2
  167. #diff -s 1 2
  168. ./s21_grep -i -e while -f file.txt ttt.txt >1
  169. grep -i -e while -f file.txt ttt.txt  >2
  170. diff -s 1 2
  171. ./s21_grep -in -e while -f file.txt ttt.txt >1
  172. grep -in -e while -f file.txt ttt.txt  >2
  173. diff -s 1 2
  174. ./s21_grep -in -e while -f file.txt ttt.txt ttt.txt >1
  175. grep -in -e while -f file.txt ttt.txt ttt.txt  >2
  176. diff -s 1 2
  177. ./s21_grep -inh -e while -f file.txt ttt.txt ttt.txt >1
  178. grep -inh -e while -f file.txt ttt.txt ttt.txt  >2
  179. diff -s 1 2
  180. ./s21_grep -inhv -e while -f file.txt ttt.txt ttt.txt >1
  181. grep -inhv -e while -f file.txt ttt.txt ttt.txt  >2
  182. diff -s 1 2
  183. ./s21_grep -v -f file.txt ttt.txt >1
  184. grep -v -f file.txt ttt.txt  >2
  185. diff -s 1 2
  186. ./s21_grep -vi -f file.txt ttt.txt >1
  187. grep -vi -f file.txt ttt.txt  >2
  188. diff -s 1 2
  189. ./s21_grep -e while -f file.txt ttt.txt ttt.sys >1
  190. grep -e while -f file.txt ttt.txt ttt.sys  >2
  191. diff -s 1 2
  192. ./s21_grep -e while -f file.txt ttt.sys >1
  193. grep -e while -f file.txt ttt.sys  >2
  194. diff -s 1 2
  195. ./s21_grep -s -e while -f file.txt ttt.txt ttt.sys >1
  196. grep -s -e while -f file.txt ttt.txt ttt.sys  >2
  197. diff -s 1 2
  198. ./s21_grep -shn -e while -f file.txt ttt.txt ttt.sys >1
  199. grep -shn -e while -f file.txt ttt.txt ttt.sys  >2
  200. diff -s 1 2
  201. ./s21_grep -e while -f file.php ttt.txt >1
  202. grep -e while -f file.php ttt.txt  >2
  203. diff -s 1 2
  204. ./s21_grep -f file.txt *.* >1
  205. grep -f file.txt *.*  >2
  206. diff -s 1 2
  207. echo "end->tests -f"
  208. echo "->tests common"
  209. ./s21_grep if ttt.txt >1
  210. grep if ttt.txt >2
  211. diff -s 1 2
  212. ./s21_grep -i if ttt.txt >1
  213. grep -i if ttt.txt >2
  214. diff -s 1 2
  215. ./s21_grep -in if ttt.txt >1
  216. grep -in if ttt.txt >2
  217. diff -s 1 2
  218. ./s21_grep -in if ttt.txt ttt.txt >1
  219. grep -in if ttt.txt ttt.txt >2
  220. diff -s 1 2
  221. ./s21_grep -inh if ttt.txt ttt.txt >1
  222. grep -inh if ttt.txt ttt.txt >2
  223. diff -s 1 2
  224. ./s21_grep -inv if ttt.txt ttt.txt >1
  225. grep -inv if ttt.txt ttt.txt >2
  226. diff -s 1 2
  227. ./s21_grep -n if file.txt *.* >1
  228. grep -n if file.txt *.* >2
  229. diff -s 1 2
  230. #./s21_grep -y if ttt.txt ttt.txt >1
  231. #grep -y if ttt.txt ttt.txt >2
  232. #diff -s 1 2
  233. ./s21_grep if -in ttt.txt >1
  234. grep if -in ttt.txt >2
  235. diff -s 1 2
  236. echo "end->common"
  237.  
RAW Paste Data