title: In bash, can the file operator (-f) be case-insensitive?
body: <p>I'm doing the following:</p>
  <pre><code>if [ -f $FILE ] ; then
      echo &quot;File exists&quot;
  fi
  </code></pre>
  <p>But I want the <code>-f</code> to be case-insensitive. That is, if FILE is <code>/etc/somefile</code>, I want -f to recognize <code>/Etc/SomeFile</code>.</p>
  <p>I can partially work around it with glob:</p>
  <pre><code>shopt -s nocaseglob
  TARG='/etc/somefile'
  
  MATCH=$TARG*    #assume it returns only one match
   
  if [[ -f $MATCH ]] ; then
      echo &quot;File exists&quot; 
  fi
  </code></pre>
  <p>but the case-insensitive globbing works only on the filename portion, not the full path. So it will not work if TARG is <code>/Etc/somefile</code>.</p>
  <p>Is there any way to do this?</p>