title: for-loop for every folder in a directory, excluding some of them
body: <p>Thank you very much in advance for helping!</p>
  
  <p>I have this code in bash:</p>
  
  <pre><code>for d in this_folder/*    
      do    
          plugin=$(basename $d)
          echo $plugin'?'
          read $plugin
      done
  </code></pre>
  
  <p>Which works like a charm. For every folders inside 'this_folder', echo it as a question and store the input into a variable with the same name. </p>
  
  <p>But now I'd like to exclude some folders, so for example, it will ask for every folder in that directory, ONLY if they are NOT any of the following folders: global, plugins, and css.</p>
  
  <p>Any ideas how can I achieve this?</p>
  
  <p>Thanks!</p>
  
  <p>UPDATE:</p>
  
  <p>This is how the final code looks like:</p>
  
  <pre><code>base="coordfinder|editor_and_options|global|gyro|movecamera|orientation|sa"
  
  &gt; vt_conf.sh
  echo "# ========== Base"     &gt;&gt; vt_conf.sh
  for d in $orig_include/@($base)
  do
      plugin=$(basename $d)
      echo "$plugin=y"         &gt;&gt; vt_conf.sh
  done
  echo ''                      &gt;&gt; vt_conf.sh
  echo "# ========== Optional" &gt;&gt; vt_conf.sh
  for d in $orig_include/!($base)
  do
      plugin=$(basename $d)
      echo "$plugin=n"         &gt;&gt; vt_conf.sh
  done
  </code></pre>