title: Loop over directory then run command
body: <p>Ive spent considerable time trying to essentially loop over a root directory, and then run a command against each directory like:</p>
  <pre><code>for dirs in os.walk(cbdir):
      print(dirs)
  </code></pre>
  <p>this will output like:</p>
  <pre><code>('CODE_BASE/gateway-developer-example/.git/refs', ['heads', 'tags', 'remotes'], [])
  ('CODE_BASE/gateway-developer-example/.git/refs/heads', [], ['master'])
  ('CODE_BASE/gateway-developer-example/.git/refs/tags', [], [])
  ('CODE_BASE/gateway-developer-example/.git/refs/remotes', ['origin'], [])
  ('CODE_BASE/gateway-developer-example/.git/refs/remotes/origin', [], ['HEAD'])
  ('CODE_BASE/gateway-developer-example/global', ['src'], ['build.gradle', 'settings.gradle'])
  ('CODE_BASE/gateway-developer-example/global/src', ['main'], [])
  ('CODE_BASE/gateway-developer-example/global/src/main', ['gateway'], [])
  ('CODE_BASE/gateway-developer-example/global/src/main/gateway', ['config', 'policy'], [])
  ('CODE_BASE/gateway-developer-example/global/src/main/gateway/config', [], ['global-policies.yml'])
  ('CODE_BASE/gateway-developer-example/global/src/main/gateway/policy', ['global-policies'], [])
  ('CODE_BASE/gateway-developer-example/global/src/main/gateway/policy/global-policies', [], ['global-received-policy.xml', 'global-completed-policy.xml'])
  </code></pre>
  <p>How can i only grab for example <code>CODE_BASE/gateway-developer-example</code>?</p>