title: Echo text to multiple files using find
body: <p>I'd like to add some simple text into some files. Specifically, I do this on Linux lpfc drivers:</p>
  
  <pre><code>ls -1 /sys/class/scsi_host/host* | awk -F '@' '{system("echo 0x0 &gt; "$1"/lpfc_log_verbose")}'
  </code></pre>
  
  <p>But thinking about common case I need to handle spaces in file names. Thus I turned to find:</p>
  
  <pre><code>find -L /sys/class/scsi_host -nowarn -maxdepth 2 -type f -name 'lpfc_log_verbose' -exec echo 0x0 &gt; {} \; 2&gt;/dev/null
  </code></pre>
  
  <p>But this seems not working. </p>
  
  <pre><code>find -L /sys/class/scsi_host -maxdepth 2 -type f -name 'lpfc_log_verbose' -exec cat {} \; 2&gt;/dev/null
  </code></pre>
  
  <p>is fine but shows my edit didn't success. So can we use redirect in find -exec? What is the correct work-around?</p>