title: Return hostname, but wait as it is no empty
body: <p>What am I doing is printing ip to file, but sometimes the file is empty. What I want to do, to run the command over and over untill it returns ip address. Now I am doing it like this:</p>
  <pre><code>sudo touch /etc/ip.txt &amp;&amp; sudo chmod a+rwx /etc/ip.txt &amp;&amp; sudo printf %s &quot;$(hostname -I)&quot; &gt; /etc/ip.txt
  </code></pre>
  <p>The thing is that I am using this IP to fill it in other files, but when it's empty other scripts can't be executed. Any sugestions?</p>