标题:
[求助]echo "^<^>命令结果的疑惑
[打印本页]
作者:
wydos
时间:
2007-3-7 08:28
标题:
[求助]echo "^<^>命令结果的疑惑
本来想显示 "<>
结果echo "^<^> 的命令结果为:"^<^>
后来改了一下:echo ^"^<^> 其显示才为:"<>
但不知道为什么要在"前加一个^,因为echo " 可以显示为:"
请高手指点一下
作者:
zhoushijay
时间:
2007-3-7 08:43
echo "^<^>
就可以了
因为>会被理解成迁移符号 ^>就是告诉它这只是个普通字符而不是指迁移符号
" 本身在P处理中没有含义,所以直接echo " 就可以,不需要说明
[
Last edited by zhoushijay on 2007-3-6 at 07:44 PM
]
作者:
wydos
时间:
2007-3-7 09:03
2 楼请运行一下echo "^<^>
你就会发现它是不可以的
作者:
zhoushijay
时间:
2007-3-7 09:07
直接用 echo "<>
""本来就有表示字符的意思
作者:
everest79
时间:
2007-3-7 10:22
echo "^<^> ==echo "<>
会将"后的按文本字符串处理
作者:
xycoordinate
时间:
2007-3-7 23:23
Quote:
E:\>echo "<>
"<>
E:\>echo "<> >1.txt
"<> >1.txt
E:\>echo "^<^>
"^<^>
E:\>echo "^<^> >1.txt
"^<^> >1.txt
E:\>echo ^"^<^>
"<>
E:\>echo ^"^<^> >1.txt
E:\>type 1.txt
"<>
echo ^"^<^>
是正解!!!
[
Last edited by xycoordinate on 2007-3-7 at 10:26 AM
]
作者:
xycoordinate
时间:
2007-3-7 23:28
Quote:
不知道为什么要在"前加一个^,
因为echo " 可以显示为:"
批处理中,你怎么应用???
Quote:
E:\>echo "
"
E:\>echo " >2.txt
" >2.txt
E:\>echo ^"
"
E:\>echo ^" >2.txt
E:\>type 2.txt
"
[
Last edited by xycoordinate on 2007-3-7 at 10:31 AM
]
作者:
zh159
时间:
2007-3-8 00:00
6 楼的:
CODE:
[Copy to clipboard]
E:\>echo ^"^<^> >1.txt
E:\>type 1.txt
"<>
如果1.txt只要"<>,用:
>1.txt echo "<>
就OK
直接用E:\>echo "<> >1.txt,会把"<> >1.txt这段显示为字符
[
Last edited by zh159 on 2007-3-7 at 11:02 AM
]
作者:
xycoordinate
时间:
2007-3-8 01:23
Quote:
Originally posted by
zh159
at 2007-3-7 11:00:
6 楼的:
CODE:
[Copy to clipboard]
E:\>echo ^"^<^> >1.txt
E:\>type 1.txt
"<>
如果1.txt只要"<>,用:
>1.txt echo "<>
就OK
直接用 ...
学习!!!!
作者:
huahua0919
时间:
2007-11-25 21:06
看的多了也乱
欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/)
Powered by Discuz! 2.5