# Assume $1 is path to directory containing views in a rails project and $2 : $1 if test -d $1 then echo 'processing..' else echo Directory path must be specified for first argument; exit fi for i in $1/*.html.erb do html2haml $i > ${i%.erb}.haml done rm $1/*.html.erb exit以下のとおりに実行します。
cd RAILS_ROOT htmls2hamls app/views/TARGETSgist