【发布时间】:2012-10-26 01:35:44
【问题描述】:
我正在创建一个构建脚本以在生成 .html 文件后对其进行扫描,但我似乎不知道如何使其工作。这是一个sn-p:
for PAGE in ${PAGES[@]}
do
echo "\t\t\t- $DIR_PRE$PAGE.html"
echo "\t\t\t- cleaning links in $DIR_PRE$PAGE.html"
php helper.php output lang=$GET+environment=prod+page=$PAGE > $SITE/$DIR_PRE$PAGE.html
find * -name \*.html -print0 | xargs -0 sed --in-place -e 's~.php~.html~g'
done
最后一个 find 命令应该在 .html 文件中找到带有 .php 扩展名的链接并将其替换为 .html 但我收到此错误:
sed: 非法选项 -- - 用法:sed 脚本 [-Ealn] [-i 扩展名] [文件 ...] sed [-Ealn] [-i extension] [-e script] ... [-f script_file] ... [file ...] - wiiu.html
【问题讨论】:
标签: unix build-script