title: Remove directories when find uses wildcard in middle of path
body: <p>I need to remove directories (and their contents) in a clean-up routine executed by cron. I'm not sure if I am approaching this correctly. To test to see what would be removed, I substituted echo rather than running and rm -rf. The issue may be that my wildcard is in the middle of a path....??</p>
  
  <pre><code>#!/bin/bash
  
  dirsPATH="/images/*/03_processed"
  
  find $dirsPATH -type d -mtime +2 -maxdepth 2 -exec echo {} \;
  </code></pre>
  
  <p>or</p>
  
  <pre><code>for i in $(find $dirsPATH -type d -mtime +2)
  do
     echo $i
  done
  </code></pre>
  
  <p>I don't want to remove the "03_processed" directories, I want to remove the contents of those directories - however when I run either of these, the output includes /images/xxxx/03_processed</p>
  
  <pre><code>/images/aaaa/03_processed
  /images/aaaa/03_processed/761010184884
  /images/aaaa/03_processed/79171833116
  /images/aaaa/03_processed/873705734964
  /images/aaaa/03_processed/997297772672
  /images/bbbb/03_processed
  /images/bbbb/03_processed
  </code></pre>
  
  <p>I've tried with a trailing "/" in the variable definition, and also in the command using "$dirsPATH/"... </p>
  
  <p>Any ideas would be appreciated - thanks</p>