title: sed extract substring between two characters from a file and save to variable
body: <p>I am automatically building a package. The automated script needs to get the version of the package to build.
  I need to get the string of the python script main.py. It says in line 15</p>
  
  <pre><code>VERSION="0.2.0.4" #DO NOT MOVE THIS LINE
  </code></pre>
  
  <p>I need the 0.2.0.4, in future it can easily become 0.10.3.15 or so, so the sed command must not have a fixed length.
  I found this on stackoverflow:</p>
  
  <pre><code>sed -n '15s/.*\#\([0-9]*\)\/.*/\1/p'
  </code></pre>
  
  <p>"This suppresses everything but the second line, then echos the digits between # and /"</p>
  
  <p>This does not work (adjusted). Which is the last "/"? How can I save the output into a variable called "version"?</p>
  
  <pre><code>version = sed -n ... 
  </code></pre>
  
  <p>throws an error </p>
  
  <blockquote>
    <p>command -n not found</p>
  </blockquote>