title: Bash: using commands as parameters (specifically cd, dirname and find)
body: <p>This command and output:</p>
  
  <pre><code>% find . -name file.xml 2&gt; /dev/null
  ./a/d/file.xml
  %
  </code></pre>
  
  <p>So this command and output:</p>
  
  <pre><code>% dirname `find . -name file.xml 2&gt; /dev/null`
  ./a/d
  %
  </code></pre>
  
  <p>So you would expect that this command:</p>
  
  <pre><code>% cd `dirname `find . -name file.xml 2&gt; /dev/null``
  </code></pre>
  
  <p>Would change the current directory to ./a/d.  Strangely this does not work.  When I type <code>cd ./a/d</code>.  The directory change works.  However I cannot find out why the above does not work...</p>