Precedence in operators issue

Hello,
I am trying to write a small acript to change directory to $HOME depending on the user logged in. However when i provide this command
say,

ABC_USER=myself
cd ~${ABC_USER} i am getting the following error,

ksh: ~myself: not found

I know i am doing something really silly but not able to figure out what it is. I know i could get the value of the home directory by doing a grep on /etc/passed file but i think it is not a good solution.

Can anyone help or have encountered this issue before? I am thinking this issue is one of precedence where "~" is evaluated before the "$".

Anyone??

It works for me...if the user is in /etc/passwd...

$
$ ABC=mail
$ grep mail /etc/passwd
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
mailnull:x:47:47::/var/spool/mqueue:/sbin/nologin
$ cd ~${ABC}
$ pwd
/var/spool/mail
$
$ ABC=fubar
$ cd ~${ABC}
ksh: cd: ~fubar: [No such file or directory]
$

Thanks for your quick reply Perdarabo.

I am using /bin/ksh . Could it be it does not work in that shell?

echo $SHELL. Can you tell me what shell you are using?

I'm using ksh just like you. Look closely in my post toward the bottom. The shell id'ed itself in the error message. My OS was RedHat 5.

Thanks .. i fixed it by grepping the path from /etc/password and changing it to that location. However the below approach did not work for me on HPUX 11.23