最佳答案
我需要将包含尖括号(< 和 >)的字符串回显到 Windows 计算机上的文件。基本上我想做的是:
echo some string < with angle > brackets >>myfile.txt
由于命令解释器会与尖括号混淆,所以不能正常工作。我可以像这样引用整个字符串:
echo "some string < with angle > brackets" >>myfile.txt
但是在我的文件中有我不想要的双引号。
省略 ala unix 中的括号也不起作用:
echo some string \< with angle \> brackets >>myfile.txt
有什么想法吗?