title: how to use substr in awk?
body: <p>I have strings that look like this</p>
  
  <pre><code>/foo/bar
  /foo/bar/1
  /foo/bar/baz
  /foo/bar/baz/1
  </code></pre>
  
  <p>I want to be able to chop off the end only if it's a number.
  For example, <code>/foo/bar</code> stays the same, but <code>/foo/bar/1</code> becomes <code>/foo/bar</code></p>
  
  <p>How to I do this in awk?</p>