0
我在詹金斯Windows批处理命令:Windows批处理命令“==”操作符怪异的行为
set /p Build=<version.txt
IF ("%Build%"=="%VERSION%") (echo version doesn't match)
IF NOT ("%Build%"=="%VERSION%") (echo version match)
其中build和版本是从构建了。上面的输出是
w:\ce-billing-release>set /p Build= 0<version.txt
w:\ce-billing-release>IF ("1.1.0" == "1.1.0") (echo version match)
w:\ce-billing-release>IF NOT ("1.1.0" == "1.1.0") (echo version doesn't match)
version doesn't match
尽管它获得了变量= 1.1.0的正确值,出于某种原因它认为它们不相等。我错过了什么?