title: How to use find utility with logical operators and post processing
body: <p>Is there way to find all directories that have executable file that matches a partial name of parent directory? </p>
  
  <p>Situation </p>
  
  <pre><code>/distribution/software_a_v1.0.0/software_a 
  /distribution/software_a_v1.0.1/software_a
  /distribution/software_a_v1.0.2/config.cfg 
  </code></pre>
  
  <p>I need result </p>
  
  <pre><code>/distribution/software_a_v1.0.0/software_a 
  /distribution/software_a_v1.0.1/software_a
  </code></pre>
  
  <p>I've gotten only so far </p>
  
  <pre><code>find /distribution -maxdepth 1 -type d  #and at depth 2 -type f -perm /u=x and binary name matches directory name, minus version  
  </code></pre>