The closest I can come up with is:
echo 123 > out.txt
However this gives a trailing space and also a trailing newline.
|
The closest I can come up with is:
However this gives a trailing space and also a trailing newline. |
||||
|
http://gnuwin32.sourceforge.net/packages.html coreutils contains "echo". You can use the "-n" flag to supress the trailing newline |
|||
|
|
|
In PowerShell:
There is no trailing space, but there is a newline. If you want to do this in cmd, the answer you provided in your question is the "correct" way, but there are obvious formatting issues |
|||
|
|
|
I've used this with success:
|
|||||||||||
|
|
I think you want this for text-based output:
|
|||||
|
|
Use copy con
Press Control-Z to end input 'con' is a keyword signifying console. copy src dest copy con mynewfile src - con - console dest - mynewfile - destination |
|||
|
|
cat 123 > out.txt; I've just edited it to refer toecho. – Keith Thompson Oct 13 '12 at 21:28