title: exclude multiple directories from find result
body: <p>I need to exclude multiple directories from find result. I know how to do it by hard coding in the <code>find</code> command, but can it be possible to store the list of excluded dir as a variable or array and later used in find command ?</p>
  
  <p>Here is my working command: In this command, I am <code>touching</code> a file called <code>dumped</code> inside all the directories in the current directories with <code>maxdepth 1</code> except <code>.</code> , <code>./tmp</code> , <code>./garbage</code> directories. </p>
  
  <pre><code>find . -maxdepth 1 ! -path "." ! -path "./tmp" ! -path "./garbage" -type d -exec touch {}/dumped  2&gt;/dev/null \;
  </code></pre>
  
  <p>If you notice I have provided hard coding in the <code>find</code> command for the directories  to be excluded. </p>
  
  <p>If there any way to store the list in a variable and pass to the <code>find</code> command ?</p>
  
  <p>something like <code>exclude_list=".|./tmp|./garbage"</code> and use it afterwards ?</p>
  
  <p>I tried following but it did not worked:</p>
  
  <pre><code>find . -maxdepth 1 ! -path ${exclude_list}
  </code></pre>