title: How do I make a symlink to every directory in the current directory that has the same name but has underscores replaced by dashes?
body: <p>For instance, I suppose I have a directory that contains the following folders</p>
  
  <pre><code>foo_bar
  baz
  </code></pre>
  
  <p>What I would like to have is a bash command that will make a symlink <code>foo-bar</code> to <code>foo_bar</code> so it would look like this:</p>
  
  <pre><code>foo-bar
  foo_bar
  baz
  </code></pre>
  
  <p>I'm pretty sure I can write a Python script to do this, but I'm curious if there's a way to do this with bash.  Here's where I'm stuck:</p>
  
  <pre><code>ls -1 | grep _ | xargs -I {} ln -s {} `{} | sed 's/_/-/'`
  </code></pre>
  
  <p>What I'm trying to do is run the command <code>ln -s</code> with the first argument being the directory name and the second argument being that name passed through <code>sed s/_/-/</code>.  Is there another way to do this?</p>