Windows batch: echo without new line

后端 未结 18 1435
失恋的感觉
失恋的感觉 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:50

    I made a function out of @arnep 's idea:

    echo|set /p="Hello World"

    here it is:

    :SL (sameline)
    echo|set /p=%1
    exit /b
    

    Use it with call :SL "Hello There"
    I know this is nothing special but it took me so long to think of it I figured I'd post it here.

提交回复
热议问题