title: specify another directory to compgen for auto completing directories, than using pwd
body: <p><code>compgen -d -- $cur</code> will suggest completions for the directories in pwd only right?</p>
  
  <p>Can I get it to suggest directory completions for some dir while being in another dir.</p>
  
  <p>For eg. if I am in <code>/curr_dir</code>, and I want to generate directory completions for <code>/other_dir</code> what do I do? How do I specify it to <code>compgen</code>, so that I don't need to go to <code>/other_dir</code></p>
  
  <p>In my bash-completion function, I tried doing a <code>cd</code> to that dir before calling <code>compgen</code> but that leaves me in the other dir after pressing <code>&lt;Tab&gt;</code>.</p>