title: Store output from my bash script in a .txt file
body: <p>I want store the output of my script in a file, but can't.</p>
  <p>This is:</p>
  <pre><code>#!/bin/bash
  
  if [ &quot;$1&quot; == &quot;&quot; ]
  then
  echo &quot;Te falta especificar una dirección ip&quot;
  echo &quot;Syntax esperado: ./hostDiscovery.sh &lt;ip&gt;&quot;
  
  else
  for ip in `seq 1 254`; do
  ping -c 1 $1.$ip | grep &quot;64 bytes&quot; | cut -d &quot; &quot; -f 4 | tr -d &quot;:&quot; | tee ip.txt &amp;
  done
  fi
  </code></pre>
  <p>The problem is that the file that was created has no data. It is blank.</p>