Search the /etc directory for files with the extension ".sh" (case insensitive) and execute the command "sed -i 's/localhost/127.0.0.1/g' {}" on each file found.
find /etc -iname '*.sh' -exec sed -i 's/localhost/127.0.0.1/g' {} \;