title: linux find with exec with > not working when inside cron
body: <p>I created a simple bash script to: find some files and execute a command.
  This command must output a content that i need to store for each execution.</p>
  
  <p>So, i have something like:</p>
  
  <pre><code>find /some/folder/ -name "*txt" -exec /bin/sh -c "/path/command -x -f {} &gt; {}.pdf" \;
  </code></pre>
  
  <p>So, i will find txt files inside <strong>/some/folder/</strong> and foreach one i will execute <strong>/path/command</strong> and pass filepath to parameter <strong>-f</strong> of <strong>/path/command</strong> and will get binary, so i just need to get ouput and add a suffix <strong>.pdf</strong>.</p>
  
  <p>The problem is that, when i execute this by hand, everything went fine.
  But when i put this inside a cron, this happens:</p>
  
  <ul>
  <li>if exists <strong>/some/folder/sample.txt</strong> i got a <strong>/some/folder/sample.txt.pdf</strong> (so, <strong>find</strong> and <strong>></strong> seems to work ok) but seems to be executed by <strong>/path/command</strong> but without <strong>-f /some/folder/sample.txt</strong> parameter.</li>
  <li><strong>/path/command</strong> seems to not get <strong>-f /some/folder/sample.txt</strong> and outputs a warning message inside created <strong>/some/folder/sample.txt.pdf</strong> indicating that need to get a <strong>-f</strong> parameter with something.</li>
  </ul>
  
  <p>Note that, again, if i execute this by command line (and not by cron), everything went fine.</p>
  
  <p>Is there anything wrong i'm doing here?</p>
  
  <p>thanks for support.</p>