#!/bin/sh hostnames() { cat < /etc/hostname sed -i -e 's/\blocalhost\b/& '"$hostname"'/' /etc/hosts