1
有一个基本的批处理脚本,该脚本使用用户MAC更新postgreSQL表,对照在脚本中硬编码的内容。当我运行它时,它认为这两个MAC地址是不同的,或者我的语法不起作用。我试图回显变量,他们看起来是一样的。批处理脚本比较
我哪里错了?
由于
@echo off
set mac=00:00:00:00
echo %mac%
set /p mac_address= Please enter the MAC address
echo %mac_address%
if mac==mac_address (
set /p hostname= Please enter the server ip address
echo "update license set lldld" >> run
SET PGPASSWORD=xxxxxxxxxx
postgresql\bin\psql -U postgres -h %hostname% -p 5434 -d jasperserver -a -f run
del run
) else (
Echo "Error with MAC code"
pause
)
Doh!很长一段时间,这是我的借口,我坚持它。非常感谢! – user1479931 2013-02-20 14:13:59