title: Bash: pinging servers and writing the IP to a file
body: <p>I currently have to find the IP-Adresses of a lot of servers.</p>
  <p>I have written a bash script on linux that creates all the server names.</p>
  <p>When I write it like this, I get all servernames, even if there no longer have an IP.</p>
  <pre><code>host $f$n$d &gt;&gt; IPs.txt
  </code></pre>
  <p>Is there a way to only write the servers into the file, that still have an IP, together with the servername.</p>
  <p>Kind regards Elias</p>