title: Checking if a file is readable and exists in one if condition: if [[ -r -f "/file.png" ]]
body: <p>I was writing an if statement which checked if a file is readable and exists by doing the following:</p>
  
  <pre><code>if [[ -r "$upFN" &amp;&amp; -f "$upFN" ]]; then
  ....
  fi
  </code></pre>
  
  <p>Then I thought, surly you can make this smaller, something maybe like this:</p>
  
  <pre><code>if [[ -r -f "$upFN" ]]; then
  ....
  fi
  </code></pre>
  
  <p>But this doesn't work, it returns errors:</p>
  
  <pre><code>./ftp.sh: line 72: syntax error in conditional expression
  ./ftp.sh: line 72: syntax error near `"$upFN"'
  ./ftp.sh: line 72: `if [[ -r -f "$upFN" ]]; then'
  </code></pre>