title: Can I use /dev/null for the find command?
body: <p>I'm updating a shell script that uses the find command that follows symlinks:</p>
  
  <pre><code>find -L somedir ...
  </code></pre>
  
  <p>However, on some older platforms, the -L isn't supported and the command must use the older -follow syntax:</p>
  
  <pre><code>find somedir -follow ...
  </code></pre>
  
  <p>The "-follow" flag is deprecated on newer systems, so my strategy is to test if the command works with the newer -L flag, and if not fall back on the -follow flag.</p>
  
  <p>The script currently runs on RedHawk 5.4.11, but the <code>find</code> incompatibility was discovered on an older Linux version.  I was directed to make this work on all Unix/Linux platforms.</p>
  
  <p>So, while creating a dummy <code>find</code> command to test, I'm creating an empty temp directory in <code>/tmp</code> for the <code>find</code> command to return quickly.  I then found out that <code>mktemp -d</code> is not supported on the older systems, so I was going to create one the old-fashioned way.</p>
  
  <p>It then dawned on me, "why not just try <code>/dev/null</code> as a temp dir instead of creating one?"  So I tried the command:</p>
  
  <pre><code>TEMPDIR=/dev/null
  FIND_L_SUPPORTED=`find -L $TEMPDIR &amp;&gt; /dev/null; echo $?`
  </code></pre>
  
  <p>and it seems to work, but I'm not sure why (since <code>/dev/null</code> is not a directory), or if it's reliable on all platforms.</p>
  
  <p>Two questions:</p>
  
  <ol>
  <li>Is using <code>find</code> against <code>/dev/null</code> reliable on all platforms?</li>
  <li>Any other solutions to my original <code>find</code> problem, where some platforms need <code>-L</code> but others need <code>-follow</code>?</li>
  </ol>