Windows批处理文件语法使用感叹号 [英] Windows batch file syntax using exclamation mark
本文介绍了Windows批处理文件语法使用感叹号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在检查Axis2二进制分发中的axis2server.bat文件的详细信息时,我看到其中一行包含类似以下内容的文本:
While checking the details of the axis2server.bat file in Axis2 binary distribution I see one of the line containing text something like:
FOR %%c in ("%AXIS2_HOME%\lib\*.jar") DO set AXIS2_CLASS_PATH=!AXIS2_CLASS_PATH!;%%c
下面带有两个感叹号的部分是什么意思?
What does the part below with 2 exclamation marks mean?
!AXIS2_CLASS_PATH!
以%表示的名称表示变量,不确定是什么!在批处理文件中标记均值.
Names with in % mean variables, not sure what ! mark mean in a batch file.
推荐答案
在循环中使用enable delayed expansion
和change
或set
变量时,!variable!
语法允许您在循环中使用变量
When you enable delayed expansion
and change
or set
a variable within a loop then the !variable!
syntax allows you to use the variable within the loop.
一个缺点是!
变成了毒字,可能会延迟扩展.
A drawback is that !
becomes a poison character for delayed expansion.
这篇关于Windows批处理文件语法使用感叹号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文