title: linux shell script: getting filename from a user input string
body: <p>I would like to write a shell script in which I'll take a line input from user,which will contain some xxx.cpp as filename.
  I want to get that "xxx" in another variable.
  e.g.</p>
  
  <p>if user give input as:</p>
  
  <pre><code>some params path/to/file/xyz.cpp more p/ara/ms
  </code></pre>
  
  <p>I want to get xyz which occurs before".cpp" and after last occurance of "/" before ".cpp"</p>