title: Why is bash echo adding new line in find results?
body: <p>When I echo the results of a find, bash is replacing the filenames' spaces with newlines. The second version shows the error. Why is that?</p>
  <p>First version:</p>
  <pre><code>#!/bin/bash
  echo &quot;Bash ${BASH_VERSION}&quot;
  for f in *.txt
  do
      echo &quot;  $f&quot;
  done
  </code></pre>
  <p>output, no errors:</p>
  <pre><code>Bash 5.0.3(1)-release
      File 1.txt
      File 2.txt
  </code></pre>
  <p>Second version:</p>
  <pre><code>#!/bin/bash
  echo &quot;Bash ${BASH_VERSION}&quot;
  for f in $(find . -maxdepth 1 -type f)
  do
      echo &quot;  $f&quot;
  done
  </code></pre>
  <p>output with errors:</p>
  <pre><code>Bash 5.0.3(1)-release
      ./File
      1.txt
      ./File
      2.txt
  </code></pre>