Removed depricated backticks.
Changed numeric comparison.
Changed reading from file, instead of cat-ing it use "in-piping" <.
Changed using the whole array of hosts.
Added double quotes to prevend of splitting words.
Changed shebang-specification.