title: How to change content in variable based on pwd in bash?
body: <p>I would like to do following:</p>
  <ol>
  <li>get all dependencies (dir names)</li>
  <li>get basename of current directory</li>
  <li>since current directory is not a dependency, get rid of it</li>
  <li>print them</li>
  </ol>
  <p>what I have so far (from <code>bashrc</code>):</p>
  <pre><code>export dep=$({ tmp=$(ls /usr/local/lib/node_modules/); echo ${tmp//$(basename $(pwd))/}; })
  </code></pre>
  <p>The goal is it to have it in variable, not a function or alias becuase I want to use it later (such as for <code>npm link $dep</code>), which I would not be able if it was function.</p>
  <p>But the current output DOES include the current directory. Was it invoked from the current dir, the current dir would not be included. So I guess the variable is not reexecuted to take into account it changed its dir (from where bashrc is, to where I am now).</p>
  <p>So how to make it to NOT include the current dir?</p>