I'll show what to me is expected, and what to me isn't..
Code: Select all
C:\>type a.bat <ENTER>
echo p1=%1 p2=%2 p3=%3
C:\>
OK
Code: Select all
C:\>a rrrrr zzzzzz <ENTER>
C:\>echo p1=rrrrr p2=zzzzzz p3=
p1=rrrrr p2=zzzzzz p3=
OK
Code: Select all
C:\>a rrrrr" zzzzzz" <ENTER>
C:\>echo p1=rrrrr" zzzzzz" p2= p3=
p1=rrrrr" zzzzzz" p2= p3=
OK
Now here is unexpected. I want to make both quotes literal. Thus making the spaces special. So i'd expect the spaces to break it so p1=rrrrr" and p2=zzzzzz"
but I get the whole thing in p1
Code: Select all
C:\>a rrrrr^" zzzzzz^"
C:\>echo p1=rrrrr" zzzzzz" p2= p3=
p1=rrrrr" zzzzzz" p2= p3=
Why are the quotes not getting escaped?
Even when I try just one literal quote it doesn't work. The quote is treated as special by the shell
Code: Select all
C:\>a rrrrr^" zzzzzz
C:\>echo p1=rrrrr" zzzzzz p2= p3=
p1=rrrrr" zzzzzz p2= p3=
C:\>
I'd expect p1=rrrrr" p2=zzzzzz
but instead I get p1 equals the whole thing. I want the quote to be literal, so the space special, and so the space i'd expect, to break the parameters. Why isn't it?
Happy New Year