使用“小于”字符在exec上使用Phing语法错误

时间:2012-01-16 23:32:47

标签: xml linux phing

我的phing构建文件中存在格式错误的XML问题。我想要一个任务,将gunzip文件,然后将其传递给mysql以恢复数据库备份。我发现有“<”命令中的符号会导致错误。

这是我当前的一行打破了构建脚本:

<exec command="gunzip < ${mysql.backup} | mysql -u ${mysql.username} -p ${mysql.password} ${mysql.database}"
            logoutput="true" checkreturn="true" />

输出:

BUILD FAILED
exception 'BuildException' with message 'Error reading project file [wrapped: /home/ec2-user/project/build.xml:206:30: > required]' in /usr/share/pear/phing/parser/ProjectConfigurator.php:197

有没有办法逃脱command=""部分?

或者更好的方法呢?

1 个答案:

答案 0 :(得分:2)

应该逃避少于不开始元素的迹象;在您的情况下,使用&lt;是最简单的方法。

相关问题