Windows批处理:echo没有新行 [英] Windows batch: echo without new line

查看:162
本文介绍了Windows批处理:echo没有新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是Windows批处理等效的Linux shell命令 echo -n ,它抑制输出结尾处的换行符?


$

解决方案

使用 set / p 参数,你可以不用换行符来回显:

  C:\> echo Hello World 
Hello World

C:\> echo | set / p =Hello World
Hello World
C:\>


What is the Windows batch equivalent of the Linux shell command echo -n which suppresses the newline at the end of the output?

The idea is to write on the same line inside a loop.

解决方案

Using set and the /p parameter you can echo without newline:

C:\> echo Hello World
Hello World

C:\> echo|set /p="Hello World"
Hello World
C:\>

Source

这篇关于Windows批处理:echo没有新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆