title: Removing pattern at the end of a string using sed or other bash tools
body: <p>I would like to remove any ABC at the end of the string. </p>
  
  <p>The best I have came up with is </p>
  
  <pre><code>echo ${String}| sed -e 's/["ABC"]*$//g'
  </code></pre>
  
  <p>However, it will remove all the A, or B or C at the end of the string. </p>
  
  <p>If String is DAAAAABCBBBCCABCABC, if I use the above expression, it will return "D", instead of "DAAAAABCBBBCC"</p>
  
  <p>Is there any better way of doing this? Thanks. </p>