Advertisement
Guest User

Untitled

a guest
Jun 15th, 2023
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.82 KB | None | 0 0
  1. original code https://pastebin.com/Gz3dDwra
  2.  
  3. console output
  4.  
  5. increasing number of percent signs, set without quotes, echo without quotes
  6.  
  7. Environment variable testvar not defined
  8. 1
  9. testvar=%
  10. 2 %
  11. testvar=%
  12. 3 %
  13. testvar=%%
  14. 4 %%
  15. testvar=%%
  16. 5 %%
  17. testvar=%%%
  18. 6 %%%
  19. testvar=%%%
  20. 7 %%%
  21. testvar=%%%%
  22. 8 %%%%
  23. observations : single percentsigns are discarded, double percentsigns are reduced to one
  24. three percentsigns, two of them get reduced to one and the extra is discarded
  25. four percentsigns gets reduced to two and so on
  26.  
  27. increasing number of percent signs, set with quote, echo without quote
  28.  
  29. Environment variable testvar not defined
  30. 1
  31. testvar=%
  32. 2 %
  33. testvar=%
  34. 3 %
  35. testvar=%%
  36. 4 %%
  37. testvar=%%
  38. 5 %%
  39. testvar=%%%
  40. 6 %%%
  41. testvar=%%%
  42. 7 %%%
  43. testvar=%%%%
  44. 8 %%%%
  45. observation, putting set variable in quotes had no effect on percentsigns parsing
  46.  
  47. increasing number of percent signs, set without quotes, echo with quotes
  48.  
  49. Environment variable testvar not defined
  50. 1 ""
  51. testvar=%
  52. 2 "%"
  53. testvar=%
  54. 3 "%"
  55. testvar=%%
  56. 4 "%%"
  57. testvar=%%
  58. 5 "%%"
  59. testvar=%%%
  60. 6 "%%%"
  61. testvar=%%%
  62. 7 "%%%"
  63. testvar=%%%%
  64. 8 "%%%%"
  65. observation, putting echo variable in double quotes had no effect on percentsigns parsing
  66.  
  67. increasing number of percent signs, set with quote, echo with quote
  68.  
  69. Environment variable testvar not defined
  70. 1 ""
  71. testvar=%
  72. 2 "%"
  73. testvar=%
  74. 3 "%"
  75. testvar=%%
  76. 4 "%%"
  77. testvar=%%
  78. 5 "%%"
  79. testvar=%%%
  80. 6 "%%%"
  81. testvar=%%%
  82. 7 "%%%"
  83. testvar=%%%%
  84. 8 "%%%%"
  85. observation, again doublequotes have had no effect on percent sign parsing
  86.  
  87. increasing number of percent signs, set without quotes, echo without quotes
  88. added letter A or B alternating before and after every percentsign
  89.  
  90. testvar=AB
  91. 1 AB
  92. testvar=AA
  93. 2 AA
  94. testvar=AAB
  95. 3 AAB
  96. testvar=AAA
  97. 4 AAA
  98. testvar=AAAA
  99. 5 AAAA
  100. testvar=AAAA
  101. 6 AAAA
  102. testvar=AAAAB
  103. 7 AAAAB
  104. testvar=AAAAA
  105. 8 AAAAA
  106. observation, all characters enclosed between sets of percentsigns are expanded into variable
  107. in this case, empty variables
  108.  
  109. increasing number of percent signs, set with quotes, echo without quotes
  110. added letter A or B alternating before and after every percentsign
  111.  
  112. testvar=AB
  113. 1 AB
  114. testvar=AA
  115. 2 AA
  116. testvar=AAB
  117. 3 AAB
  118. testvar=AAA
  119. 4 AAA
  120. testvar=AAAA
  121. 5 AAAA
  122. testvar=AAAA
  123. 6 AAAA
  124. testvar=AAAAB
  125. 7 AAAAB
  126. testvar=AAAAA
  127. 8 AAAAA
  128. observation, set with quotes had no effect of percentsign parsing
  129.  
  130. increasing number of percent signs, set without quotes, echo with quotes
  131. added letter A or B alternating before and after every percentsign
  132.  
  133. testvar=AB
  134. 1 "AB"
  135. testvar=AA
  136. 2 "AA"
  137. testvar=AAB
  138. 3 "AAB"
  139. testvar=AAA
  140. 4 "AAA"
  141. testvar=AAAA
  142. 5 "AAAA"
  143. testvar=AAAA
  144. 6 "AAAA"
  145. testvar=AAAAB
  146. 7 "AAAAB"
  147. testvar=AAAAA
  148. 8 "AAAAA"
  149. observation, echo with quotes had no effect of percentsign parsing
  150.  
  151. increasing number of percent signs, set with quotes, echo with quotes
  152. added letter A or B alternating before and after every percentsign
  153.  
  154. testvar=AB
  155. 1 "AB"
  156. testvar=AA
  157. 2 "AA"
  158. testvar=AAB
  159. 3 "AAB"
  160. testvar=AAA
  161. 4 "AAA"
  162. testvar=AAAA
  163. 5 "AAAA"
  164. testvar=AAAA
  165. 6 "AAAA"
  166. testvar=AAAAB
  167. 7 "AAAAB"
  168. testvar=AAAAA
  169. 8 "AAAAA"
  170. observation, set and set with quotes had no effect of percentsign parsing
  171.  
  172. increasing number of percent signs, set without quotes, echo without quotes
  173. added letter AAA or BBB alternating before and after every percentsign
  174.  
  175. testvar=AAABBB
  176. 1 AAABBB
  177. testvar=AAAAAA
  178. 2 AAAAAA
  179. testvar=AAAAAABBB
  180. 3 AAAAAABBB
  181. testvar=AAAAAAAAA
  182. 4 AAAAAAAAA
  183. testvar=AAAAAAAAAAAA
  184. 5 AAAAAAAAAAAA
  185. testvar=AAAAAAAAAAAA
  186. 6 AAAAAAAAAAAA
  187. testvar=AAAAAAAAAAAABBB
  188. 7 AAAAAAAAAAAABBB
  189. testvar=AAAAAAAAAAAAAAA
  190. 8 AAAAAAAAAAAAAAA
  191. 'observation' is not recognized as an internal or external command,
  192. operable program or batch file.
  193.  
  194. increasing number of percent signs, set with quotes, echo without quotes
  195. added letter AAA or BBB alternating before and after every percentsign
  196.  
  197. testvar=AAABBB
  198. 1 AAABBB
  199. testvar=AAAAAA
  200. 2 AAAAAA
  201. testvar=AAAAAABBB
  202. 3 AAAAAABBB
  203. testvar=AAAAAAAAA
  204. 4 AAAAAAAAA
  205. testvar=AAAAAAAAAAAA
  206. 5 AAAAAAAAAAAA
  207. testvar=AAAAAAAAAAAA
  208. 6 AAAAAAAAAAAA
  209. testvar=AAAAAAAAAAAABBB
  210. 7 AAAAAAAAAAAABBB
  211. testvar=AAAAAAAAAAAAAAA
  212. 8 AAAAAAAAAAAAAAA
  213. 'observation' is not recognized as an internal or external command,
  214. operable program or batch file.
  215.  
  216. increasing number of percent signs, set without quotes, echo with quotes
  217. added letter AAA or BBB alternating before and after every percentsign
  218.  
  219. testvar=AAABBB
  220. 1 "AAABBB"
  221. testvar=AAAAAA
  222. 2 "AAAAAA"
  223. testvar=AAAAAABBB
  224. 3 "AAAAAABBB"
  225. testvar=AAAAAAAAA
  226. 4 "AAAAAAAAA"
  227. testvar=AAAAAAAAAAAA
  228. 5 "AAAAAAAAAAAA"
  229. testvar=AAAAAAAAAAAA
  230. 6 "AAAAAAAAAAAA"
  231. testvar=AAAAAAAAAAAABBB
  232. 7 "AAAAAAAAAAAABBB"
  233. testvar=AAAAAAAAAAAAAAA
  234. 8 "AAAAAAAAAAAAAAA"
  235. 'observation' is not recognized as an internal or external command,
  236. operable program or batch file.
  237.  
  238. increasing number of percent signs, set with quotes, echo with quotes
  239. added letter AAA or BBB alternating before and after every percentsign
  240.  
  241. testvar=AAABBB
  242. 1 "AAABBB"
  243. testvar=AAAAAA
  244. 2 "AAAAAA"
  245. testvar=AAAAAABBB
  246. 3 "AAAAAABBB"
  247. testvar=AAAAAAAAA
  248. 4 "AAAAAAAAA"
  249. testvar=AAAAAAAAAAAA
  250. 5 "AAAAAAAAAAAA"
  251. testvar=AAAAAAAAAAAA
  252. 6 "AAAAAAAAAAAA"
  253. testvar=AAAAAAAAAAAABBB
  254. 7 "AAAAAAAAAAAABBB"
  255. testvar=AAAAAAAAAAAAAAA
  256. 8 "AAAAAAAAAAAAAAA"
  257. 'observation' is not recognized as an internal or external command,
  258. operable program or batch file.
  259.  
  260. increasing number of percent signs
  261. added letter AAA or BBB alternating before and after every percentsign
  262. This one will have 8 percent signs with various locations to include doublequotes
  263.  
  264. testvar=A"AAAAAAAAAAAAAA
  265. 1 A"AAAAAAAAAAAAAA
  266. testvar=AAAAAAAAAAAAAAA
  267. 2 AAAAAAAAAAAAAAA
  268. testvar=AAAAA"AAAAAAAAAA
  269. 3 AAAAA"AAAAAAAAAA
  270. testvar=AAAAA"AAAAAAAAAA
  271. 4 AAAAA"AAAAAAAAAA
  272. testvar=A"AAAA"AAAAAAAAAA
  273. 5 A"AAAA"AAAAAAAAAA
  274. testvar=AAA"AAAAAAAAAAAA
  275. 6 AAA"AAAAAAAAAAAA
  276. testvar=A"A"AAAAAAAAAAAAA
  277. 7 A"A"AAAAAAAAAAAAA
  278. testvar=AAAAAAAAAAAAAAA
  279. 8 AAAAAAAAAAAAAAA
  280. testvar=AAAAAAAAAAAAAAA
  281. 9 AAAAAAAAAAAAAAA
  282. testvar=AAAAAAAAAAAAAAA
  283. 1 AAAAAAAAAAAAAAA
  284. testvar=AAAAAAAAAAA"AAAA
  285. 2 AAAAAAAAAAA"AAAA
  286. testvar=AAAAAAAAAAA"AAAA
  287. 3 AAAAAAAAAAA"AAAA
  288. testvar=AAAAAAAAA"A"A"AAAA
  289. 4 AAAAAAAAA"A"A"AAAA
  290. testvar=AAAAAAAAAA"A"A"AAA
  291. 5 AAAAAAAAAA"A"A"AAA
  292. testvar=AAAAAAAAA"A"A"A"AAA
  293. 6 AAAAAAAAA"A"A"A"AAA
  294. observation, no matter where the quotes are places, appears to have no impact on the percentsign parsing
  295.  
  296. same pattern as previous, this time with added carrets ^ for escaping percent signs
  297. Doublequotes are left in, expected to have no effects on percent sign parsing
  298.  
  299. testvar=A"AA^AAAAAAAAAAAA
  300. 1 A"AA^AAAAAAAAAAAA
  301. testvar=AAAAAAAAAAAAAAA
  302. 2 AAAAAAAAAAAAAAA
  303. testvar=AAAAA"AAAAAAAAAA
  304. 3 AAAAA"AAAAAAAAAA
  305. testvar=AAAAA"AAA^AAAAAAA
  306. 3 AAAAA"AAA^AAAAAAA
  307. testvar=AAAAA"AAA^AAAAAAA
  308. 3 AAAAA"AAA^AAAAAAA
  309. testvar=AAA^AA"AAA^AAAAAAA
  310. 3 AAAAA"AAA^AAAAAAA
  311. testvar=AAA^AA"AAA^AAAAAAA
  312. 3 "AAA^AA"AAAAAAAAAA"
  313. testvar=^AAA^^AA"AAAAA^AAA^AA
  314. 3 "^AAA^^AA"AAAAAAAAAA"
  315. observation, carrets appear to have no effect on percentsign parsing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement