title: How do we match a suffix in a string in bash?
body: <p>I want to check if an input parameter ends with ".c"? How do I check that? Here is what I got so far (Thanks for your help):</p>
  
  <pre><code>#!/bin/bash
  
  for i in $@
  do
      if [$i ends with ".c"]
      then
              echo "YES"
          fi
  done
  </code></pre>