中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-30 02:55
47,813 topics / 349,918 posts / today 0 new / 48,278 members
DOS学习入门 & 精彩文章 (教学室) » Puzzles about the echo command writing to files
Printable Version  2,809 / 5
Floor1 rsarew Posted 2007-02-14 00:46
初级用户 Posts 9 Credits 20
In DOS, you can use the echo test>a.txt to create a text file named a.txt with the content test.

I want to ask, when using the echo command to write echo <%script %> >a.txt, it cannot be written to the file. What methods are there to solve this?

Also, in DOS, is there any way to modify a certain line of a file, just like vi?

Thank you everyone.
Floor2 vk Posted 2007-02-14 02:08
中级用户 Posts 86 Credits 218
echo ^<%script%^> >a.txt
This way you can successfully write the text
Floor3 rsarew Posted 2007-02-14 04:22
初级用户 Posts 9 Credits 20
Floor4 nhwgq Posted 2009-11-25 16:46
新手上路 Posts 1 Credits 2
Floor5 fujiang1000 Posted 2009-12-16 23:37
初级用户 Posts 36 Credits 44
Echo hello world>filename can write the string 'hello world' into the file. Then you can run type filename, and you can see hello world displayed. Of course, you can also use the command echo nul>filename to clear the file without deleting it. Note: it's nul, not null @_@
Floor6 Sunjoy Posted 2009-12-17 07:24
初级用户 Posts 17 Credits 29
Originally posted by vk at 2007-2-14 02:08:
echo ^<%script%^> >a.txt
This way you can successfully write the text.


Good use of escape characters!~
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023