title: List directories not containing certain files?
body: <p>I used this command to find all the directories containing .mp3 in the current directory, and filtered out only the directory names:</p>
  
  <pre><code>find . -iname "*.mp3" | sed -e 's!/[^/]*$!!' -e 's!^\./!!' | sort -u
  </code></pre>
  
  <p>I now want the opposite, but I found it a little harder. I can't just add a '!' to the find command since it'll only exclude .mp3 when printing them not find directories that do not contain .mp3.</p>
  
  <p>I googled this and searched on stackoverflow and unix.stackexchange.com.
  I have tried this script so far and it returns this error:</p>
  
  <pre><code>#!/bin/bash
  
  find . -type d | while read dir
  do
  if [[! -f $dir/*.mp3 ]]
  then
      echo $dir
  fi
  done
  </code></pre>
  
  <p>/home/user/bin/try.sh: line 5: [[!: command not found</p>
  
  <pre><code>#!/bin/bash
  
  find . -type d | while read dir
  do
  if [! -f $dir/*.mp3 ]
  then
      echo $dir
  fi
  done
  </code></pre>
  
  <p>/home/user/bin/try.sh: line 5: [!: command not found</p>
  
  <pre><code>#!/bin/bash
  
  find . -type d | while read dir
  do
  if [[! -f "$dir/*.mp3" ]]
  then
      echo $dir
  fi
  done
  </code></pre>
  
  <p>/home/user/bin/try.sh: line 5: [!: command not found</p>
  
  <p>I'm thinking it has to do with multiple arguments for the test command.</p>
  
  <p>Since I'm testing all the directories the variable is going to change, and I use a wildcard for the filenames.</p>
  
  <p>Any help is much appreciated.  Thank You.</p>