Windows batch: echo without new line

后端 未结 18 1426
失恋的感觉
失恋的感觉 2020-11-22 04:01

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 t

18条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-22 04:46

    Echo with preceding space and without newline

    As stated by Pedro earlier, echo without new line and with preceding space works (provided "9" is a true [BackSpace]).

    I had some issues getting it to work in Windows 10 with the new console but managed the following way.
    In CMD type:

    echo .◘>bs.txt
    

    I got "◘" by pressing [Alt] + [8]
    (the actual symbol may vary depending upon codepage).

    Then it's easy to copy the result from "bs.txt" using Notepad.exe to where it's needed.

    @echo off
    

提交回复
热议问题