cmd.exe is also allowing unclosed quotes, with is frankly a PITA
D:\tmp\exp>perl -E"say join'|',@ARGV" "1\" 2" "3
1" 2|3
And I already noticed that the escaped quotes are killing my workaround
D:\tmp\exp>type cmd_wrapper.bat
@echo off
echo %*| perl.exe .\wrapped_pl.pl
D:\tmp\exp>cmd_wrapper.bat "1\" 2"
"1\" 2"| perl.exe .\wrapped_pl.pl
what seems to happen is that
- %* is expanded like a macro before executing the bat
- The second quote is not considered escaped for echo
- The pipe is seen as part of an unclosed "string"
- hence the call to perl.exe is echo'ed like a string and never executed
|