title: How to extract only version from "go version" command using sed or other bash command in bash shell script running on Debian 10
body: <p>The command <code>go version</code> currently prints <code>go version go1.13.6 linux/amd64</code>. I installed from the go website rather than Debian packages as the version is old. Therefore traditional ways to extract the version number like <code>dpkg -s</code> cannot be used.</p>
  
  <p>I've explored <code>sed</code> commands to extract only the number (1.13.6) <a href="https://stackoverflow.com/questions/15305065/regex-to-extract-version-from-string">like this</a> other question on this site which is similar I grant you, however after reading various sources online about whats possible with sed and my limited knowledge I've been unable to work out how to tell <code>sed</code> to find the starting point, yet alone make it future proof for new versions which may be slight alterations of this number format. I've tried to explore ways to say "find the 3rd to last number" so that I can then work backwards. Or, "find the 2nd word 'go'".</p>
  
  <p>Current efforts have been purely theoretical, as I can't find where to begin, I've not included any attempts.</p>
  
  <p>Can it be done?</p>