China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-07-02 00:42
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Can one echo output multiple lines? View 3,497 Replies 18
Floor 16 Posted 2008-01-27 21:21 ·  中国 福建 福州 联通
高级用户
★★
Credits 581
Posts 277
Joined 2006-12-23 05:10
19-year member
UID 74328
Gender Male
Status Offline
Today I found that using ^ with echo is really useful. Let's learn new usages.
Floor 17 Posted 2009-12-20 13:55 ·  中国 北京 中国科学院研究生院
新手上路
Credits 14
Posts 9
Joined 2008-11-24 19:17
17-year member
UID 131988
Gender Male
Status Offline
@echo 1^
2^
3^
>test.txt

You can take a look at the result in test.txt after running. What is seen when opened with Notepad is different from that opened with Edit. It seems that Notepad handles line breaks differently from other editors.
Floor 18 Posted 2009-12-21 21:35 ·  中国 广东 韶关 电信
高级用户
★★★
CMD感染者
Credits 691
Posts 383
Joined 2008-05-23 00:38
18-year member
UID 119451
Gender Male
Status Offline
Another grave digger
There really is a treasure
Floor 19 Posted 2009-12-22 23:36 ·  中国 陕西 安康 电信
初级用户
Credits 58
Posts 29
Joined 2008-08-15 19:21
17-year member
UID 123291
Gender Male
Status Offline
test.bat:

@echo 123^

456^

789


Use in CMD:
test | more >temp.txt
Forum Jump: