title: How can I get the value out of this "while read" loop in Bash?
body: <p>So I have this loop</p>
  
  <pre><code>    largest=0
      find $path -type f |  while read line; do
              largest=$(stat -c '%s' $line)
      done | sort -nr | head -1
      echo $largest
  </code></pre>
  
  <p>but the variable gets reset after the loop because of the bash subshell thing.</p>
  
  <p>Is there a simple fix I could use to get this variable out?</p>