test ~ expand

PADURARIU Lucian Ionut <[email protected]> Wed, 26 Feb 2003 19:42:56 +0200 (EET)
Newsgroups gmane.comp.gnu.sh-utils.bugs
Message-ID <[email protected]>
given : 
in ~joe a file named a.txt
and the next script :

------------
#!/bin/bash
$a=joe
test -e ~$a/a.txt && echo "yes"
------------

it does not output anything.
WHY NOT ????????

and if we do : 
test -e ~joe/a.txt && echo "yes"

it writes at stdin "yes"

WHY ????????????