why does this code output this result

May 29, 2019 at 01:34:47
Specs: windows 10
code:

set "^=escapeOnly"
set hi=hi001
set str1="a^!bcd^!efg^^^^^^^^^^^^^!^^^^^^^^^^^!^^^^^^^^^^!hi^^^^^^^^^!^^^^!^!"


echo ----- original ----
echo  !str1!


echo ----- other 4 ----- 2x
echo " %str1%

output:

----- original ----
 "a!bcd!efg^^^^^^!^^^^^!^^^^^^^escapeOnly "

----- other 4 ----- 2x
" "aefg^!^^escapeOnly "

my confusion is in other 4, I tried to do expand and escape operations to build output in my mind, but I can not understand why my code output this.

thanks


See More: why does this code output this result

Reply ↓  Report •
Related Solutions


Ask Question