我想在文本文件中写入“ <”或“>”符号。我尝试过的一个例子:
echo echo. >file2.txt>file1.txt
但这是行不通的。我想要的是使用下面的文本制作批处理文件make file2.txt:
echo. >file1.txt
有人知道该怎么做吗?
退出<
或>
使用^
。请注意,要实际重定向到文件,您将需要一个额外的重定向运算符。
这是一个使用示例>
-相同的解决方案适用于<
(也适用于%
)。
echo .^> > file.txt
因此,echo. file2.txt > file1.txt
在名为redir.txt的文本文件中获得想要的结果(一个包含的文本文件):
echo echo. file2.txt ^> file1.txt > redir.txt
最终结果在redir.txt中:
c:\temp>type redir.txt
echo. file2.txt > file.txt
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句