title: sed error complaining "extra characters after command"
body: <pre><code>#!/bin/bash
  
  # Let's say now, we are working in my $HOME directory
  
  # Content of testfile (originally)
  # 123456
  # ABCDEF
  # /home/superman
  
  string="ABCDEF"
  myfile="$HOME/testfile"
  
  # test-1, this is okay
  sed -i "/$string/d" $myfile
  echo $string &gt;&gt; $myfile
  
  # test-2, this fails
  # ERROR (sed: -e expression #1, char 4: extra characters after command)
  sed -i "/$PWD/d" $myfile
  echo $PWD &gt;&gt; $myfile
  
  # Not working either
  sed -i ":$PWD:d" $myfile
  echo $PWD &gt;&gt; $myfile
  </code></pre>
  
  <p>My question: How to handle the $PWD situation?</p>