title: How to use printf with conditional arguments
body: <p>I'm trying to print <code>file</code> if <code>$files</code> is 0 or 1 and <code>files</code> if greater than 1. What is the concise way to do this in bash?</p>
  
  <p>I tried using 'printf' as follows,</p>
  
  <pre class="lang-sh prettyprint-override"><code>files=13;
  printf 'There are %s file%s' $files $(($files &gt; 1 ? 's' : ''))
  </code></pre>
  
  <p>and as expected this doesn't work out.</p>
  
  <p>Could someone tell me how to achieve this?</p>