title: Difference between $HOME and '~' (tilde)?
body: <p>I had always thought that <code>$HOME</code> and <code>~</code> were exactly the same and thus could
  be used interchangeably. Today, when I tried to install <em>pylibmc</em>, a python
  binding to memcached, on my shared server the use of <code>~</code> gave me error but not
  <code>$HOME</code>. I would like to reason out why.</p>
  
  <p><em>libmemcached</em> is a requirement for <em>pylibmc</em>. I have <em>libmemcached</em> installed
  under my home directory because I have no root on the server. As a result, to
  install <em>pylibmc</em>, I need to make sure the installation script knows where to
  find <em>libmemcached</em>.</p>
  
  <p>When executing <code>python setup.py install --with-libmemcached=~</code>, the installation
  script runs</p>
  
  <pre>
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall \
    -Wstrict-prototypes -fPIC -DUSE_ZLIB -I~/include \
    -I/usr/local/include/python2.7 -c _pylibmcmodule.c \
    -o build/temp.linux-i686-2.7/_pylibmcmodule.o -fno-strict-aliasing
  </pre>
  
  <p>which gives the errors that <em>libmemcached</em> can't be found.</p>
  
  <p>If I change to <code>--with-libmemcached=$HOME</code>, the script runs</p>
  
  <pre>
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall \
    -Wstrict-prototypes -fPIC -DUSE_ZLIB -I/home/waterbotte/include \
    -I/usr/local/include/python2.7 -c _pylibmcmodule.c \
    -o build/temp.linux-i686-2.7/_pylibmcmodule.o -fno-strict-aliasing
  </pre>
  
  <p>without any problem. It looks like the problem is that tilde doesn't get resolved. But why?</p>