title: How to parse the file name string from a file path in shell script?
body: <p>I have files in directory  'new_kb'. I want to iterate on each file and execute a c++ binary on the file, like below:</p>
  <pre><code>kb_dir=./new_kb
  for entry in &quot;$kb_dir&quot;/*
  do
    echo &quot;$entry&quot;
     $file_name  = parse(entry)
    ./build &quot;$file_name&quot;/&quot;$file_name&quot;.txt 
    done
  </code></pre>
  <p>One example of 'entry' is:</p>
  <pre><code>./new_kb/peopleObj.txt
  </code></pre>
  <p>from the variable path 'entry', I need to parse the string below out:</p>
  <pre><code>'peopleObj' 
  </code></pre>
  <p>How to do this in a shell script?</p>