|
pzf2008
新手上路

积分 16
发帖 13
注册 2008-12-8
状态 离线
|
『楼 主』:
Echo命令如何把">"符号写入到文本中?
使用 LLM 解释/回答一下
@echo off
echo.%%1>>11.bat
echo.pause
如果我想在%%1的后面写入“>”符号,就是要实现11.bat中的内容如下:
%1>
怎么实现呢?
@echo off
echo.%%1^>>11.bat
echo.pause
In the original code, to output the `>` symbol correctly in the echo command, you need to use `^>` to escape it. So the modified code for echoing `%1>` into 11.bat is `echo.%%1^>>11.bat`.
|
|
2009-3-16 06:31 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
这要看纯DOS环境还是CMD环境,如果是CMD环境,只需要在>前加上^即可。如:
echo %%1^>>11.bat
而如果是纯DOS环境,很显然上面这种方法就不行了,一个比较简单的方法是借用prompt $g字符转义功能,详细用法我不太记得了(因为很少用),你可以搜索以前的老帖子,我印象中willsort曾经有帖子系统的讨论过这个问题,在本版的置顶精华帖子汇总中应该有链接。
Last edited by Climbing on 2009-3-19 at 03:09 ]
This depends on whether it is a pure DOS environment or a CMD environment. If it is a CMD environment, you only need to add ^ before >. For example:
echo %%1^>>11.bat
And if it is a pure DOS environment, obviously the above method won't work. A relatively simple method is to borrow the prompt $g character escape function. I don't remember the detailed usage very well (because I rarely use it). You can search for old posts before. I remember that willsort once had a post that systematically discussed this problem. There should be a link in the top essence post summary of this version.
Last edited by Climbing on 2009-3-19 at 03:09 ]
|

偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
|
|
2009-3-17 02:31 |
|
|
ben1314
初级用户
 
积分 25
发帖 16
注册 2007-10-27 来自 河南新乡
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
不曾用过 DOS下没有用过CMD下倒是常用
Never used DOS, but often used under CMD
|
|
2009-3-18 22:05 |
|
|
dnntgmfd
初级用户
 
积分 85
发帖 52
注册 2009-1-10 来自 湘乡
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
二楼的,,
echo %%1^>11.bat中
那个^前面是不是还要加个>
On the second floor,,
In echo %%1^>11.bat, is there still a > needed in front of the ^?
|
|
2009-3-19 01:33 |
|
|
Climbing
铂金会员
       网络独行侠
积分 6962
发帖 2753
注册 2003-4-16 来自 河北保定
状态 离线
|
『第 5 楼』:
Re: 4楼的
使用 LLM 解释/回答一下
已经在二楼修正。
It has been corrected on the second floor.
|

偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
|
|
2009-3-19 03:10 |
|
|
pkto
初级用户
 
积分 62
发帖 62
注册 2007-7-14
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
谢谢Climbing正在愁这个问题,就解决了!
Thanks, Climbing was worrying about this problem, and it's solved!
|
|
2009-10-7 13:01 |
|
|
aktm
新手上路

积分 2
发帖 1
注册 2009-10-15
状态 离线
|
|
2009-10-16 12:47 |
|
|
qvbzyx
新手上路

积分 11
发帖 6
注册 2009-10-3
状态 离线
|
|
2009-10-18 18:38 |
|
|
pkto
初级用户
 
积分 62
发帖 62
注册 2007-7-14
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
不但如此,如果=后面跟着数字,如=3,那么3前面也要加上^,表达成=^3,呵呵,很有意思的,类似的还有%,必须再加一个,表达成%%,才能输出正确的%
Not only that, if there is a number following =, such as =3, then ^ must be added before 3, expressed as =^3. Hehe, it's very interesting. Similarly, for %, another % must be added, expressed as %%, to output the correct %.
|
|
2009-10-21 11:37 |
|
|
yidos2008
新手上路

积分 19
发帖 7
注册 2008-10-10
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
说真的要是有人讲下DEBUG还是不错的
``想学这个就是难了点``看不懂
Seriously, it would be good if someone explained DEBUG. "The problem is it's a bit difficult to learn" I can't understand it.
|
|
2009-10-21 17:30 |
|