#!/bin/bash for d in `ls ls -d */` do cd $d for i in `ls *.html` do echo $i #sed 's##\n#g' $i > $i.new sed "s#www.clinicaps.com.br#clinicapsmen.com#g" $i > $i.new mv $i.new $i rm $i.new done cd .. done