![](/img/trans.png)
[英]How can I use a file in a command and redirect output to the same file without truncating it (Windows)?
[英]Redirect the output of a command to file without newline in windows
我需要将命令行输出重定向到文件而不在Windows中使用换行符。
例如,
"%VISUALSVN_SERVER%bin\svnlook.exe" log -r 128 C:\Repositories > log.txt
此命令的输出只是一行。 在这里,我需要将输出重定向到没有换行符的log.txt文件。
我可以通过以下命令在没有换行符的情况下回显变量,
echo | set /p log=log_comments>log.txt
提前致谢。
您可以使用相同的技巧和for /f
循环:
for /f %%L in ('"%VISUALSVN_SERVER%bin\svnlook.exe" log -r 128 C:\Repositories') do (
<nul set /p "X=%%L" >log.txt
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.