我在嵌套目录中有很多html文件,我需要转换为Haml模板 我已经从这里修改了以下bash脚本 - http://terrbear.org/?p=277来修改html文件而不是erb但是我仍然需要将其修改为递归...
#!/bin/bash
if [ -z "$1" ]; then
wdir="."
else
wdir=$1
fi
for f in $( ls $wdir/*.html ); do
out="${f%}.haml"
if [ -e $out ]; then
echo "skipping $out; already exists"
else
echo "hamlifying $f"
html2haml $f > $out
fi
done
我已将此脚本命名为h2h.sh并尝试使用
等命令h2h.sh `find . -type d`
我在终端
中没有输出由于
答案 0 :(得分:0)
# find . -type d -exec ./h2h.sh {} \;