title: Find and delete all symlinks in home folder, having trouble making it work
body: <p>I have the following:</p>
  
  <pre><code>read -p 'Delete old symlinks? y/n: ' prompt
  
  if [ $prompt == [yY] ]
  then    
      current_dir=$(pwd)
      script_dir=$(dirname $0)
  
      if [ $script_dir = '.' ]
      then
          script_dir="$current_dir"
      fi
  
      for sym in {find $PATH -type l -xtype d -lname "~"}
      do
          rm $sym
          echo "Removed: $sym"
      done
  fi
  </code></pre>
  
  <p>What I'm trying to achieve is the following:</p>
  
  <ul>
  <li>If prompt equals y (yes)
  Then:
  Find all the symlinks in <code>~</code> (home directory) and do a for loop on them which would delete them and output which one it deleted.</li>
  </ul>
  
  <p>Although right now it doesn't do the deleting part, the rest works fine. I didn't include the part that works, it's just a bunch of <code>ln -s</code>.</p>
  
  <p>I am in Mac OS X Mountain Lion (10.8.2), using Zsh as shell, this goes in a <code>.sh</code> file.</p>
  
  <p>The problem I am having is that nothing happens, and so it just says:</p>
  
  <pre><code>ln: /Users/eduan/.vim/vim: File exists
  ln: /Users/eduan/.vimrc: File exists
  ln: /Users/eduan/.gvimrc: File exists
  Done...
  </code></pre>
  
  <p>etc.</p>
  
  <p>Many thanks for any help you can provide!</p>
  
  <p><strong>EDIT:</strong><br />
  I now have the following:</p>
  
  <pre><code>read -p 'Delete old symlinks? y/n: ' prompt
  
  if [ $prompt == [yY] ]
  then    
     find ~ -type l | while read line
     do
        rm -v "$line"
     done
  fi
  </code></pre>