title: How to check if a symlink target matches a specific path?
body: <p>I'm creating a bash script to check if a symlink target matches a specific path so, in case it doesn't match, script removes the symlink. I've tried with <code>readlink</code>:</p>
  
  <pre><code>#!/bin/env bash
  
  target_path=$HOME/Code/slate/.slate.js
  
  if [ `readlink $HOME/.slate.js` == "$target_path" ]; then
      rm -rf "$HOME/.slate.js"
  fi
  </code></pre>
  
  <p>but it doesn't work:</p>
  
  <pre><code>%source test
  test:5: = not found
  </code></pre>