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

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

问题描述

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

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.

推荐答案

使用 set/p 参数你可以在没有换行符的情况下回显:

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:>

来源

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

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