I\'m looking to convert an entire directory of HTML to HAML so that the files have the same name but with a new extension.
html2haml file.html.erb file.haml
You could do something like this:
for f in *.html.erb; do html2haml $f ${f/\.html\.erb/.haml}; done
Edit: If you need to look for template files recursively and you're using bash 4.x, then you can use globstar:
bash
shopt -s globstar for f in **/*.html.erb; do html2haml $f ${f/\.html\.erb/.haml}; done