tags:

views:

49

answers:

1

I have many html files in nested directories which I need to convert to Haml templates I've modified the following bash script from here - http://terrbear.org/?p=277 to modify html files and not erb but I still need to modify it to be recursive ...

#!/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

I've named this script h2h.sh and tried going for commands like

h2h.sh `find . -type d`

I'm getting no output in the terminal

Thanks

A: 
# find . -type d -exec ./h2h.sh {} \;
joefis